EventDispatcher

class HPS.EventDispatcher : HPS.Object

The EventDispatcher class is used for injecting any events and dealing with event handlers which handle those events.

Public Functions

override void Dispose ()
bool Equals (HPS.EventDispatcher in_that)

Check if the source EventDispatcher is equivalent to this object.

Param in_that:The source EventDispatcher to compare to this object.
Return:true if the objects are equivalent, false otherwise.
override bool Equals (Object obj)
EventDispatcher ()

The default constructor creates an uninitialized EventDispatcher object which cannot be subscribed to.

EventDispatcher (HPS.EventDispatcher in_that)

The copy constructor creates an EventDispatcher object that points to the same underlying impl as the source EventDispatcher.

Param in_that:The source EventHandler to point to.
override int GetHashCode ()
bool InjectEvent (HPS.Event in_event)

Inject the specified event and propagate it to all subscribed handlers in the order of subscription.

Param in_event:Event to inject and propagate.
Return:true if the event injection was successful, false otherwise.
HPS.EventNotifier InjectEventWithNotifier (HPS.Event in_event)

Inject the specified event and propagate it to all subscribed handlers in the order of subscription and return an EventNotifier associated with the injected event.

Param in_event:Event to inject and propagate.
Return:An event notifier associated with the injected event.
bool IsShutdown ()

Query whether the asynchronous shutdown has completed.

Return:true if the event dispatcher has shutdown, false otherwise.
override HPS.Type ObjectType ()

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Return:The declared type of the object in question, which may differ from the true, underlying type.
void SetName (string in_name)

Sets the EventDispatcher’s name

Param in_name:Name to set.
void ShowName (out string out_name)

Shows the EventDispatcher’s name

Param out_name:Current name of this EventDispatcher.
void Shutdown ()

Shutdown this EventDispatcher asynchronously. Any pending events injected into this EventDispatcher will be processed prior to shutdown, but no new events can be injected.

bool Subscribe (HPS.EventHandler in_handler, IntPtr in_type)

Add the specified event handler to the list of subscribers for events of the specified type on this EventDispatcher.

Param in_handler:
 Event handler to add to the subscriber list for events of the given type.
Param in_type:Type of event to add the handler for.
Return:true if the subscription was successful, false otherwise.
bool UnSubscribe (HPS.EventHandler in_handler)

Remove the specified event handler from the list of subscribers for events of the specified type on this EventDispatcher.

Param in_handler:
 Event handler to remove from the subscriber list for events of the given type.
Return:true if the unsubscription was successful, false otherwise.
bool UnSubscribe (HPS.EventHandler in_handler, IntPtr in_type)

Remove the specified event handler from the list of subscribers for events of the specified type on this EventDispatcher.

Param in_handler:
 Event handler to remove from the subscriber list for events of the given type.
Param in_type:Type of event to remove the handler for.
Return:true if the unsubscription was successful, false otherwise.
bool UnSubscribe (IntPtr in_type)

Remove the specified event handler from the list of subscribers for events of the specified type on this EventDispatcher.

Param in_type:Type of event to remove the handler for.
Return:true if the unsubscription was successful, false otherwise.

Public Static Functions

bool operator!= (HPS.EventDispatcher a, HPS.EventDispatcher b)
bool operator== (HPS.EventDispatcher a, HPS.EventDispatcher b)