Table of Contents

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

delegates Dictionary<object, List<Action>>

The delegates to be bound.

Properties

BoundDelegates

Gets all the bound delegates.

public IReadOnlyDictionary<object, List<Action>> BoundDelegates { get; }

Property Value

IReadOnlyDictionary<object, List<Action>>

this[object]

This indexer allows access to bound listeners using an object reference.

public KeyValuePair<object, List<Action>> this[object @object] { get; }

Parameters

object object

The 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

obj object

The listener instance.

del Action

The delegate to be bound.

Invoke(object)

Invokes the delegates from the specified listener.

public virtual void Invoke(object obj)

Parameters

obj object

The 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

obj object

The 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

left DynamicEventDispatcher

The DynamicEventDispatcher to bind the listener from.

right DynamicDelegate

The 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

left DynamicEventDispatcher

The DynamicEventDispatcher to bind the listeners from.

right DynamicEventDispatcher

The 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

left DynamicEventDispatcher

The DynamicEventDispatcher to bind the listener to.

right Action

The 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

left DynamicEventDispatcher

The DynamicEventDispatcher to unbind the listener from.

right DynamicDelegate

The 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

left DynamicEventDispatcher

The DynamicEventDispatcher to unbind the listeners from.

right DynamicEventDispatcher

The 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

left DynamicEventDispatcher

The DynamicEventDispatcher to unbind the listener from.

right Action

The delegate to bind.

Returns

DynamicEventDispatcher

The left-hand DynamicEventDispatcher operator.