Class Event<THandler>
Provides typed access to static event declared in type THandler.
Implements
Inherited Members
Namespace: DotNext.Reflection
Assembly: DotNext.Reflection.dll
Syntax
public sealed class Event<THandler> : EventBase<THandler>, IEquatable<EventInfo>, IEvent<THandler>, IEvent, IMember<EventInfo>, ICustomAttributeProvider where THandler : MulticastDelegate
Type Parameters
| Name | Description |
|---|---|
| THandler | Type of event handler. |
Methods
| Improve this Doc View SourceAddEventHandler(THandler)
Add event handler.
Declaration
public void AddEventHandler(THandler handler)
Parameters
| Type | Name | Description |
|---|---|---|
| THandler | handler | An event handler to add. |
AddEventHandler(Object, THandler)
Adds static event handler.
Declaration
public override bool AddEventHandler(object target, THandler handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | target | Should be null. |
| THandler | 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. |
Overrides
| Improve this Doc View SourceRemoveEventHandler(THandler)
Remove event handler.
Declaration
public void RemoveEventHandler(THandler handler)
Parameters
| Type | Name | Description |
|---|---|---|
| THandler | handler | An event handler to remove. |
RemoveEventHandler(Object, THandler)
Removes static event handler.
Declaration
public override bool RemoveEventHandler(object target, THandler handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | target | Should be null. |
| THandler | 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. |
Overrides
Operators
| Improve this Doc View SourceUnaryNegation(Event<THandler>)
Returns a delegate which can be used to detach from the event.
Declaration
public static Action<THandler> operator -(Event<THandler> event)
Parameters
| Type | Name | Description |
|---|---|---|
| Event<THandler> | event | Reflected event. |
Returns
| Type | Description |
|---|---|
| Action<THandler> | The delegate which can be used to detach from the event. |
UnaryPlus(Event<THandler>)
Returns a delegate which can be used to attach new handlers to the event.
Declaration
public static Action<THandler> operator +(Event<THandler> event)
Parameters
| Type | Name | Description |
|---|---|---|
| Event<THandler> | event | Reflected event. |
Returns
| Type | Description |
|---|---|
| Action<THandler> | The delegate which can be used to attach new handlers to the event. |