WeakEventManager.Purge(Object, Object, Boolean) Method
Definition
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
Parameters
- 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
.
Returns
true
if some entries were actually removed; otherwise, false
.
Remarks
The Purge method has a default implementation that will remove all entries when data is a WeakEventManager.ListenerList.
Notes to Inheritors
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().
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기