WeakEventT Class |
Namespace: DigitalRune
The WeakEventT type exposes the following members.
Name | Description | |
---|---|---|
WeakEventT | Initializes a new instance of the WeakEventT class |
Name | Description | |
---|---|---|
Add(Delegate) |
Adds a new Delegate to the WeakMulticastDelegate.
(Inherited from WeakMulticastDelegate.) | |
Add(T) |
Adds a new Delegate of a given type to the
WeakMulticastDelegateT.
(Inherited from WeakMulticastDelegateT.) | |
Equals | (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Invoke(Object) |
Invokes the stored Delegates with the given arguments.
(Inherited from WeakMulticastDelegate.) | |
Invoke(Object, EventArgs) |
Raises the event.
| |
Remove(Delegate) |
Removes a Delegate from the WeakMulticastDelegate.
(Inherited from WeakMulticastDelegate.) | |
Remove(T) |
Removes a Delegate of a given type from the
WeakMulticastDelegateT.
(Inherited from WeakMulticastDelegateT.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Count |
Gets the number of live delegates in the collection.
(Inherited from WeakMulticastDelegate.) |
class MyEventSource { private readonly WeakEvent<EventHandler<EventArgs>> _myEvent = new WeakEvent<EventHandler<EventArgs>>(); public event EventHandler<EventArgs> MyEvent { add { _myEvent.Add(value); } remove { _myEvent.Remove(value); } } protected virtual void OnMyEvent(EventArgs eventArgs) { _myEvent.Invoke(this, eventArgs); } }