C# Class Open.Core.EventBus

An event aggregator.
Inheritance: IEventBus, IDisposable
Afficher le fichier Open project: philcockfield/Open.TestHarness.SL Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
EventBus ( object key ) : System

Constructor.

GetHandler ( System.Action handler ) : EventBusHandler

Method Details

Clear() public méthode

Clears all event handlers.
public Clear ( ) : void
Résultat void

Dispose() public méthode

Destructor.
public Dispose ( ) : void
Résultat void

GetSingleton() public static méthode

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.
Résultat IEventBus

Subscribe() public méthode

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.
Résultat void

Unsubscribe() public méthode

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