Class Event<T, THandler>
Provides typed access to instance event declared in type T
.
Implements
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public sealed class Event<T, THandler> : EventBase<THandler>, IEquatable<EventInfo>, IEvent<T, THandler>, IEvent, IMember<EventInfo>, ICustomAttributeProvider where THandler : MulticastDelegate
Type Parameters
Name | Description |
---|---|
T | Declaring type. |
THandler | Type of event handler. |
Methods
| Improve this Doc View SourceAddEventHandler(T, THandler)
Adds an event handler to an event source.
Declaration
public void AddEventHandler(in T target, THandler handler)
Parameters
Type | Name | Description |
---|---|---|
T | target | The event source. |
THandler | handler | Encapsulates a method or methods to be invoked when the event is raised by the target. |
AddEventHandler(Object, THandler)
Adds an event handler to an event source.
Declaration
public override bool AddEventHandler(object target, THandler handler)
Parameters
Type | Name | Description |
---|---|---|
Object | target | The event source. |
THandler | handler | Encapsulates a method or methods to be invoked when the event is raised by the target. |
Returns
Type | Description |
---|---|
Boolean | true, if arguments are correct; otherwise, false. |
Overrides
AddEventHandler(Object, Delegate)
Adds an event handler to an event source.
Declaration
public override void AddEventHandler(object target, Delegate handler)
Parameters
Type | Name | Description |
---|---|---|
Object | target | The event source. |
Delegate | handler | Encapsulates a method or methods to be invoked when the event is raised by the target. |
Overrides
| Improve this Doc View SourceRemoveEventHandler(T, THandler)
Removes an event handler from an event source.
Declaration
public void RemoveEventHandler(in T target, THandler handler)
Parameters
Type | Name | Description |
---|---|---|
T | target | The event source. |
THandler | handler | The delegate to be disassociated from the events raised by target. |
RemoveEventHandler(Object, THandler)
Removes an event handler from an event source.
Declaration
public override bool RemoveEventHandler(object target, THandler handler)
Parameters
Type | Name | Description |
---|---|---|
Object | target | The event source. |
THandler | handler | The delegate to be disassociated from the events raised by target. |
Returns
Type | Description |
---|---|
Boolean | true, if arguments are correct; otherwise, false. |
Overrides
RemoveEventHandler(Object, Delegate)
Removes an event handler from an event source.
Declaration
public override void RemoveEventHandler(object target, Delegate handler)
Parameters
Type | Name | Description |
---|---|---|
Object | target | The event source. |
Delegate | handler | The delegate to be disassociated from the events raised by target. |
Overrides
Operators
| Improve this Doc View SourceUnaryNegation(Event<T, THandler>)
Returns a delegate which can be used to detach from the event.
Declaration
public static Event<T, THandler>.Accessor operator -(Event<T, THandler> event)
Parameters
Type | Name | Description |
---|---|---|
Event<T, THandler> | event | Reflected event. |
Returns
Type | Description |
---|---|
Event.Accessor<> | The delegate which can be used to detach from the event. |
UnaryPlus(Event<T, THandler>)
Returns a delegate which can be used to attach new handlers to the event.
Declaration
public static Event<T, THandler>.Accessor operator +(Event<T, THandler> event)
Parameters
Type | Name | Description |
---|---|---|
Event<T, THandler> | event | Reflected event. |
Returns
Type | Description |
---|---|
Event.Accessor<> | The delegate which can be used to attach new handlers to the event. |