WeakEventManager.Purge(Object, Object, Boolean) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Removes inactive listener entries from the data list for the provided source. Returns true
if some entries were actually removed from the list.
protected:
virtual bool Purge(System::Object ^ source, System::Object ^ data, bool purgeAll);
protected virtual bool Purge(object source, object data, bool purgeAll);
abstract member Purge : obj * obj * bool -> bool
override this.Purge : obj * obj * bool -> bool
Protected Overridable Function Purge (source As Object, data As Object, purgeAll As Boolean) As Boolean
- source
- Object
The source for events being listened to.
- data
- Object
The data to check. This object is expected to be a WeakEventManager.ListenerList implementation.
- purgeAll
- Boolean
true
to stop listening to source
, and completely remove all entries from data
.
true
if some entries were actually removed; otherwise, false
.
The Purge method has a default implementation that will remove all entries when data is a WeakEventManager.ListenerList.
If the underlying type for the Item[Object] is something other than WeakEventManager.ListenerList, or contains data beyond a WeakEventManager.ListenerList, you must override the Purge(Object, Object, Boolean) method. The override should provide purge behavior for the alternate type items list. Generally, the override should provide behavior without calling the base implementation. If a specific WeakEventManager.ListenerList still needs clearing, call Purge().
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: