|
Joutsen v0.5.0+12-g5dd5f7e
|
An interface describing an event bus that can be used to register to events of other objects or listen to events of other objects without ever holding a reference to them. More...
Public Member Functions | |
| void | RegisterReceiver< TPayload > (String name, Action< string, TPayload > receiver) |
| Removes a listener for an event. More... | |
| void | RemoveReceiver< TPayload > (String name, Action< string, TPayload > receiver) |
| Removes a listener for an event. More... | |
| void | SendEvent< TPayload > (String name, TPayload payload) |
Fires the event with the given payload. More... | |
| Event< TPayload > | GetEvent< TPayload > (String name) |
Fetches the event with the given name and TPayload from the bus. More... | |
| void | AddEvent< TPayload > (Event< TPayload > newEvent) |
| Adds a new event to the bus for other objects listen for. More... | |
| Event< TPayload > | AddEvent< TPayload > (String newEventName) |
| Creates a new Framework.System.Events.Event and adds it to the bus. More... | |
| Event< TPayload > | TryAddEvent< TPayload > (Event< TPayload > newEvent) |
| Adds a new event if no event with the same name and type of payload is registered yet. More... | |
| Event< TPayload > | TryAddEvent< TPayload > (String newEventName) |
| Creates and adds a new event if no event with the same name and type of payload is registered yet. More... | |
| bool | RemoveEvent< TPayload > (Event< TPayload > existingEvent) |
| Removes an event from the bus. More... | |
| Event< TPayload > | RemoveEvent< TPayload > (String name) |
| Removes an event from the bus. More... | |
| bool | CanHandleEvent< TPayload > (Event< TPayload > existingEvent) |
| Checks if an event with the same name and payload is registered on the bus. More... | |
| bool | CanHandleEvent< TPayload > (String eventName) |
| Checks if an event with the given name and payload is registered on the bus. More... | |
An interface describing an event bus that can be used to register to events of other objects or listen to events of other objects without ever holding a reference to them.
| void Joutsen.Events.EventBus.AddEvent< TPayload > | ( | Event< TPayload > | newEvent | ) |
Adds a new event to the bus for other objects listen for.
| TPayload | the event's payload |
| newEvent | the new event that is added to bus |
Implemented in Joutsen.Events.DefaultEventBus.
| Event< TPayload > Joutsen.Events.EventBus.AddEvent< TPayload > | ( | String | newEventName | ) |
Creates a new Framework.System.Events.Event and adds it to the bus.
| TPayload | the event's payload |
| newEventName | the name of the new event |
Implemented in Joutsen.Events.DefaultEventBus.
| bool Joutsen.Events.EventBus.CanHandleEvent< TPayload > | ( | Event< TPayload > | existingEvent | ) |
Checks if an event with the same name and payload is registered on the bus.
| TPayload | the event's payload |
| existingEvent | the existing event to look for on the bus |
Implemented in Joutsen.Events.DefaultEventBus.
| bool Joutsen.Events.EventBus.CanHandleEvent< TPayload > | ( | String | eventName | ) |
Checks if an event with the given name and payload is registered on the bus.
| TPayload | the event's payload |
| eventName | the name of the event |
Implemented in Joutsen.Events.DefaultEventBus.
| Event< TPayload > Joutsen.Events.EventBus.GetEvent< TPayload > | ( | String | name | ) |
Fetches the event with the given name and TPayload from the bus.
| TPayload | the event's payload |
| name | the name of the event |
name and TPayload | void Joutsen.Events.EventBus.RegisterReceiver< TPayload > | ( | String | name, |
| Action< string, TPayload > | receiver | ||
| ) |
Removes a listener for an event.
| TPayload | the event's payload |
| name | the name of the event |
| receiver | the listener that is to be removed |
| bool Joutsen.Events.EventBus.RemoveEvent< TPayload > | ( | Event< TPayload > | existingEvent | ) |
Removes an event from the bus.
| TPayload | the event's payload |
| existingEvent | the event to remove |
Implemented in Joutsen.Events.DefaultEventBus.
| Event< TPayload > Joutsen.Events.EventBus.RemoveEvent< TPayload > | ( | String | name | ) |
Removes an event from the bus.
| TPayload | the event's payload |
| name | the name of the event |
Implemented in Joutsen.Events.DefaultEventBus.
| void Joutsen.Events.EventBus.RemoveReceiver< TPayload > | ( | String | name, |
| Action< string, TPayload > | receiver | ||
| ) |
Removes a listener for an event.
| TPayload | the event's payload |
| name | the name of the event |
| receiver | the listener that is to be removed |
| void Joutsen.Events.EventBus.SendEvent< TPayload > | ( | String | name, |
| TPayload | payload | ||
| ) |
Fires the event with the given payload.
| TPayload | the type of the event's payload |
| name | the name of the event |
| payload | the payload of the event |
Adds a new event if no event with the same name and type of payload is registered yet.
| TPayload | the type of the event's payload |
| newEvent | the new event |
Implemented in Joutsen.Events.DefaultEventBus.
| Event< TPayload > Joutsen.Events.EventBus.TryAddEvent< TPayload > | ( | String | newEventName | ) |
Creates and adds a new event if no event with the same name and type of payload is registered yet.
| TPayload | the type of the event's payload |
| newEventName | the name of the event |
Implemented in Joutsen.Events.DefaultEventBus.