Class DynamicEventDispatcher
- Namespace
- Exiled.API.Features.DynamicEvents
- Assembly
- Exiled.API.dll
The class which handles delegates dynamically acting as multicast listener.
public class DynamicEventDispatcher : TypeCastObject<DynamicEventDispatcher>, IDynamicEventDispatcher
- Inheritance
-
DynamicEventDispatcher
- Implements
- Inherited Members
- Extension Methods
Constructors
DynamicEventDispatcher()
Initializes a new instance of the DynamicEventDispatcher class.
public DynamicEventDispatcher()
DynamicEventDispatcher(Dictionary<object, List<Action>>)
Initializes a new instance of the DynamicEventDispatcher class.
public DynamicEventDispatcher(Dictionary<object, List<Action>> delegates)
Parameters
delegatesDictionary<object, List<Action>>The delegates to be bound.
Properties
BoundDelegates
Gets all the bound delegates.
public IReadOnlyDictionary<object, List<Action>> BoundDelegates { get; }
Property Value
this[object]
This indexer allows access to bound listeners using an object reference.
public KeyValuePair<object, List<Action>> this[object @object] { get; }
Parameters
objectobjectThe listener to look for.
Property Value
- KeyValuePair<object, List<Action>>
The obund listener corresponding to the specified reference.
Methods
Bind(object, Action)
Binds a listener to the event dispatcher.
public virtual void Bind(object obj, Action del)
Parameters
Invoke(object)
Invokes the delegates from the specified listener.
public virtual void Invoke(object obj)
Parameters
objobjectThe listener instance.
InvokeAll()
Invokes all the delegates from all the bound delegates.
public virtual void InvokeAll()
Unbind(object)
Unbinds a listener from the event dispatcher.
public virtual void Unbind(object obj)
Parameters
objobjectThe listener instance.
UnbindAll()
Unbinds all the delegates from all the bound delegates.
public virtual void UnbindAll()
Operators
operator +(DynamicEventDispatcher, DynamicDelegate)
Binds a listener from the event dispatcher.
public static DynamicEventDispatcher operator +(DynamicEventDispatcher left, DynamicDelegate right)
Parameters
leftDynamicEventDispatcherThe DynamicEventDispatcher to bind the listener from.
rightDynamicDelegateThe TDynamicDelegate<T> containing the listener to bind.
Returns
- DynamicEventDispatcher
The left-hand DynamicEventDispatcher operator.
operator +(DynamicEventDispatcher, DynamicEventDispatcher)
Binds all bound listeners to a DynamicEventDispatcher to the event dispatcher.
public static DynamicEventDispatcher operator +(DynamicEventDispatcher left, DynamicEventDispatcher right)
Parameters
leftDynamicEventDispatcherThe DynamicEventDispatcher to bind the listeners from.
rightDynamicEventDispatcherThe DynamicEventDispatcher containing the listeners to bind.
Returns
- DynamicEventDispatcher
The left-hand DynamicEventDispatcher operator.
operator +(DynamicEventDispatcher, Action)
Binds a delegate the event dispatcher.
public static DynamicEventDispatcher operator +(DynamicEventDispatcher left, Action right)
Parameters
leftDynamicEventDispatcherThe DynamicEventDispatcher to bind the listener to.
rightActionThe delegate to bind.
Returns
- DynamicEventDispatcher
The left-hand DynamicEventDispatcher operator.
operator -(DynamicEventDispatcher, DynamicDelegate)
Unbinds a listener from the event dispatcher.
public static DynamicEventDispatcher operator -(DynamicEventDispatcher left, DynamicDelegate right)
Parameters
leftDynamicEventDispatcherThe DynamicEventDispatcher to unbind the listener from.
rightDynamicDelegateThe TDynamicDelegate<T> containing the listener to unbind.
Returns
- DynamicEventDispatcher
The left-hand DynamicEventDispatcher operator.
operator -(DynamicEventDispatcher, DynamicEventDispatcher)
Unbinds all bound listeners to a DynamicEventDispatcher from the event dispatcher.
public static DynamicEventDispatcher operator -(DynamicEventDispatcher left, DynamicEventDispatcher right)
Parameters
leftDynamicEventDispatcherThe DynamicEventDispatcher to unbind the listeners from.
rightDynamicEventDispatcherThe DynamicEventDispatcher containing the listeners to unbind.
Returns
- DynamicEventDispatcher
The left-hand DynamicEventDispatcher operator.
operator -(DynamicEventDispatcher, Action)
Unbinds a delegate the event dispatcher.
public static DynamicEventDispatcher operator -(DynamicEventDispatcher left, Action right)
Parameters
leftDynamicEventDispatcherThe DynamicEventDispatcher to unbind the listener from.
rightActionThe delegate to bind.
Returns
- DynamicEventDispatcher
The left-hand DynamicEventDispatcher operator.