Class WeakEventHandlerManager
Implements functionalists for using the System.WeakReference
Inheritance
System.Object
WeakEventHandlerManager
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Presentation.Commands
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public static class WeakEventHandlerManager
Methods
View SourceAddWeakReferenceHandler(ref List<WeakReference>, EventHandler, Int32)
Adds a handler to the supplied list in a weak way.
Declaration
public static void AddWeakReferenceHandler(ref List<WeakReference> handlers, EventHandler handler, int defaultListSize)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.WeakReference> | handlers | Existing handler list. It will be created if null. |
System.EventHandler | handler | Handler to add. |
System.Int32 | defaultListSize | Default list size. |
CallWeakReferenceHandlers(Object, List<WeakReference>)
Invokes the handlers
Declaration
public static void CallWeakReferenceHandlers(object sender, List<WeakReference> handlers)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.Collections.Generic.List<System.WeakReference> | handlers |
RemoveWeakReferenceHandler(List<WeakReference>, EventHandler)
Removes an event handler from the reference list.
Declaration
public static void RemoveWeakReferenceHandler(List<WeakReference> handlers, EventHandler handler)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.WeakReference> | handlers | Handler list to remove reference from. |
System.EventHandler | handler | Handler to remove. |