C# Class Open.Core.EventBus

An event aggregator.
Inheritance: IEventBus, IDisposable
ファイルを表示 Open project: philcockfield/Open.TestHarness.SL Class Usage Examples

Public Methods

Method Description
Clear ( ) : void

Clears all event handlers.

Dispose ( ) : void

Destructor.

GetSingleton ( object key ) : IEventBus

Retrieves a singleton instance of an event-bus with the given key.

Subscribe ( Type eventType, System.Action handler ) : void

Adds a handler for a specific event type.

Unsubscribe ( System.Action handler ) : void

Removes a handler.

Private Methods

Method Description
EventBus ( object key ) : System

Constructor.

GetHandler ( System.Action handler ) : EventBusHandler

Method Details

Clear() public method

Clears all event handlers.
public Clear ( ) : void
return void

Dispose() public method

Destructor.
public Dispose ( ) : void
return void

GetSingleton() public static method

Retrieves a singleton instance of an event-bus with the given key.
public static GetSingleton ( object key ) : IEventBus
key object The unique identifier of the event-bus.
return IEventBus

Subscribe() public method

Adds a handler for a specific event type.
public Subscribe ( Type eventType, System.Action handler ) : void
eventType System.Type The type of the event.
handler System.Action The handler to invoke when the event is fired.
return void

Unsubscribe() public method

Removes a handler.
public Unsubscribe ( System.Action handler ) : void
handler System.Action The event handle to unsubscribe.
return void