StrangeIoC  0.6.0
The IoC/Binding Framework for Unity3D and C#
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | List of all members
strange.extensions.dispatcher.eventdispatcher.api.IEventDispatcher Interface Reference

Interface for allowing a client to register as an observer. More...

Inheritance diagram for strange.extensions.dispatcher.eventdispatcher.api.IEventDispatcher:
strange.extensions.dispatcher.api.IDispatcher strange.extensions.dispatcher.eventdispatcher.impl.EventDispatcher

Public Member Functions

IEventBinding Bind (object key)
 
void AddListener (object evt, EventCallback callback)
 Add an observer with exactly one argument to this Dispatcher.
 
void AddListener (object evt, EmptyCallback callback)
 Add an observer with exactly no arguments to this Dispatcher.
 
void RemoveListener (object evt, EventCallback callback)
 Remove a previously registered observer with exactly one argument from this Dispatcher.
 
void RemoveListener (object evt, EmptyCallback callback)
 Remove a previously registered observer with exactly no arguments from this Dispatcher.
 
bool HasListener (object evt, EventCallback callback)
 Returns true if the provided observer is already registered.
 
bool HasListener (object evt, EmptyCallback callback)
 Returns true if the provided observer is already registered.
 
void UpdateListener (bool toAdd, object evt, EventCallback callback)
 By passing true, an observer with exactly one argument will be added to this Dispatcher.
 
void UpdateListener (bool toAdd, object evt, EmptyCallback callback)
 By passing true, an observer with exactly no arguments will be added to this Dispatcher.
 
void ReleaseEvent (IEvent evt)
 Allow a previously retained event to be returned to its pool.
 
- Public Member Functions inherited from strange.extensions.dispatcher.api.IDispatcher
void Dispatch (object eventType)
 Send a notification of type eventType. More...
 
void Dispatch (object eventType, object data)
 Send a notification of type eventType and the provided data payload. More...
 

Detailed Description

Interface for allowing a client to register as an observer.

EventDispatcher allows a client to register as an observer. Whenever the Dispatcher executes a Dispatch(), observers will be notified of any event (Key) for which they have registered.

EventDispatcher dispatches IEvents.

The EventDispatcher is the only Dispatcher currently released with Strange (though by separating EventDispatcher from Dispatcher I'm obviously signalling that I don't think it's the only possible one).

See Also
strange.extensions.dispatcher.eventdispatcher.api.IEvent

The documentation for this interface was generated from the following file: