Class TDynamicEventDispatcher<T>
The DynamicEventDispatcher's generic version which accepts a type parameter.
Implements
Inherited Members
Namespace: Exiled.API.Features.DynamicEvents
Assembly: Exiled.API.dll
Syntax
public class TDynamicEventDispatcher<T> : TypeCastObject<DynamicEventDispatcher>, IDynamicEventDispatcher
Type Parameters
Name | Description |
---|---|
T | The event type parameter. |
Constructors
| Improve this Doc View SourceTDynamicEventDispatcher()
Initializes a new instance of the TDynamicEventDispatcher<T> class.
Declaration
public TDynamicEventDispatcher()
TDynamicEventDispatcher(Dictionary<Object, List<Action<T>>>)
Initializes a new instance of the TDynamicEventDispatcher<T> class.
Declaration
public TDynamicEventDispatcher(Dictionary<object, List<Action<T>>> delegates)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.Object, System.Collections.Generic.List<System.Action<T>>> | delegates | The delegates to be bound. |
Properties
| Improve this Doc View SourceBoundDelegates
Gets all the bound delegates.
Declaration
public IReadOnlyDictionary<object, List<Action<T>>> BoundDelegates { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyDictionary<System.Object, System.Collections.Generic.List<System.Action<T>>> |
Item[Object]
This indexer allows access to bound listeners using an System.Object reference.
Declaration
public KeyValuePair<object, List<Action<T>>> this[object object] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Object | object | The listener to look for. |
Property Value
Type | Description |
---|---|
System.Collections.Generic.KeyValuePair<System.Object, System.Collections.Generic.List<System.Action<T>>> | The obund listener corresponding to the specified reference. |
Methods
| Improve this Doc View SourceBind(Object, Action<T>)
Binds a listener to the event dispatcher.
Declaration
public virtual void Bind(object obj, Action<T> del)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The listener instance. |
System.Action<T> | del | The delegate to be bound. |
Invoke(Object, T)
Invokes the delegates from the specified listener.
Declaration
public virtual void Invoke(object obj, T instance)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The listener instance. |
T | instance | The . |
InvokeAll(T)
Invokes all the delegates from all the bound delegates.
Declaration
public virtual void InvokeAll(T instance)
Parameters
Type | Name | Description |
---|---|---|
T | instance | The parameter instance. |
Unbind(Object)
Unbinds a listener from the event dispatcher.
Declaration
public virtual void Unbind(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The listener instance. |
UnbindAll()
Declaration
public virtual void UnbindAll()
Operators
| Improve this Doc View SourceAddition(TDynamicEventDispatcher<T>, TDynamicDelegate<T>)
Binds a listener to the event dispatcher.
Declaration
public static TDynamicEventDispatcher<T> operator +(TDynamicEventDispatcher<T> left, TDynamicDelegate<T> right)
Parameters
Type | Name | Description |
---|---|---|
TDynamicEventDispatcher<T> | left | The TDynamicEventDispatcher<T> to bind the listener to. |
TDynamicDelegate<T> | right | The TDynamicDelegate<T> containing the listener to bind. |
Returns
Type | Description |
---|---|
TDynamicEventDispatcher<T> | The left-hand TDynamicEventDispatcher<T> operator. |
Addition(TDynamicEventDispatcher<T>, TDynamicEventDispatcher<T>)
Binds all bound listeners to a TDynamicEventDispatcher<T> to the event dispatcher.
Declaration
public static TDynamicEventDispatcher<T> operator +(TDynamicEventDispatcher<T> left, TDynamicEventDispatcher<T> right)
Parameters
Type | Name | Description |
---|---|---|
TDynamicEventDispatcher<T> | left | The TDynamicEventDispatcher<T> to bind the listeners to. |
TDynamicEventDispatcher<T> | right | The TDynamicEventDispatcher<T> containing the listeners to bind. |
Returns
Type | Description |
---|---|
TDynamicEventDispatcher<T> | The left-hand TDynamicEventDispatcher<T> operator. |
Addition(TDynamicEventDispatcher<T>, Action<T>)
Binds a delegate the event dispatcher.
Declaration
public static TDynamicEventDispatcher<T> operator +(TDynamicEventDispatcher<T> left, Action<T> right)
Parameters
Type | Name | Description |
---|---|---|
TDynamicEventDispatcher<T> | left | The TDynamicEventDispatcher<T> to bind the listener to. |
System.Action<T> | right | The delegate to bind. |
Returns
Type | Description |
---|---|
TDynamicEventDispatcher<T> | The left-hand TDynamicEventDispatcher<T> operator. |
Subtraction(TDynamicEventDispatcher<T>, TDynamicDelegate<T>)
Unbinds a delegate from the event dispatcher.
Declaration
public static TDynamicEventDispatcher<T> operator -(TDynamicEventDispatcher<T> left, TDynamicDelegate<T> right)
Parameters
Type | Name | Description |
---|---|---|
TDynamicEventDispatcher<T> | left | The TDynamicEventDispatcher<T> to unbind the delegate from. |
TDynamicDelegate<T> | right | The TDynamicDelegate<T> containing the delegate to unbind. |
Returns
Type | Description |
---|---|
TDynamicEventDispatcher<T> | The left-hand TDynamicEventDispatcher<T> operator. |
Subtraction(TDynamicEventDispatcher<T>, TDynamicEventDispatcher<T>)
Unbinds all bound listeners to a TDynamicEventDispatcher<T> from the event dispatcher.
Declaration
public static TDynamicEventDispatcher<T> operator -(TDynamicEventDispatcher<T> left, TDynamicEventDispatcher<T> right)
Parameters
Type | Name | Description |
---|---|---|
TDynamicEventDispatcher<T> | left | The TDynamicEventDispatcher<T> to unbind the listeners from. |
TDynamicEventDispatcher<T> | right | The TDynamicEventDispatcher<T> containing the listeners to unbind. |
Returns
Type | Description |
---|---|
TDynamicEventDispatcher<T> | The left-hand TDynamicEventDispatcher<T> operator. |
Subtraction(TDynamicEventDispatcher<T>, Action<T>)
Unbinds a delegate the event dispatcher.
Declaration
public static TDynamicEventDispatcher<T> operator -(TDynamicEventDispatcher<T> left, Action<T> right)
Parameters
Type | Name | Description |
---|---|---|
TDynamicEventDispatcher<T> | left | The TDynamicEventDispatcher<T> to unbind the listener from. |
System.Action<T> | right | The delegate to unbind. |
Returns
Type | Description |
---|---|
TDynamicEventDispatcher<T> | The left-hand TDynamicEventDispatcher<T> operator. |