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