Click or drag to resize

PropertyStoreAddEvent Method

Adds a generic event delegate with the specified key

Namespace:  Eto
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public void AddEvent(
	Object key,
	Delegate value
)

Parameters

key
Type: SystemObject
Key of the event to add to
value
Type: SystemDelegate
Delegate to add to the event
Remarks
This should be called in an event's add accessor. If you are adding a handler-based event, call AddHandlerEvent(String, Delegate) instead, which will automatically tell the handler that it needs to be wired up. You can use any subclass of EventArgs for the type of event handler To trigger the event, use TriggerEventT(Object, Object, T).
Examples
Example implementation of a generic event
static readonly object MySomethingEventKey = new object();

public event EventHandler<EventArgs> MySomething
{
    add { Properties.AddEvent(MySomethingEvent, value); }
    remove { Properties.RemoveEvent(MySomethingEvent, value); }
}
See Also