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