|
Joutsen
v0.4.1
|
A base class for events that do not dispatch immediately but delay dispatching in order to collect multiple instances and dispatch them together. More...
Public Member Functions | |
| AggregatingEvent (string name) | |
| in derived classes creates a new instance of an event. More... | |
| override void | Fire (TPayload payload) |
Fires the event with the payload. More... | |
Public Member Functions inherited from Joutsen.System.Events.PayloadEvent< TPayload > | |
| PayloadEvent (String eventName) | |
| Creates a new instance of an event. More... | |
Protected Member Functions | |
| void | FireAggregatedEvent (Task task=null) |
| Fires the event with the aggregated payload. More... | |
| abstract TPayload | Aggregate (TPayload newPayload, TPayload aggregatedPayload) |
| Can be used in child classes to implement the aggregation of the payload. More... | |
Properties | |
| TimeSpan | AggregationInterval [get, set] |
| The time to delay firing the event in order to aggregate changes in the payload. More... | |
Properties inherited from Joutsen.System.Events.PayloadEvent< TPayload > | |
| string | Name [get] |
| The name of the event which will also be passed to the listeners when the event is fired. More... | |
Properties inherited from Joutsen.System.Events.Event< TPayload > | |
| String | Name [get] |
| The name of the event which will also be passed to the listeners when the event is fired. More... | |
Additional Inherited Members | |
Events inherited from Joutsen.System.Events.PayloadEvent< TPayload > | |
| Action< string, TPayload > | Fired |
| The .NET event that will be fired if the event is fired. More... | |
Events inherited from Joutsen.System.Events.Event< TPayload > | |
| Action< string, TPayload > | Fired |
| The .NET event that will be fired if the event is fired. More... | |
A base class for events that do not dispatch immediately but delay dispatching in order to collect multiple instances and dispatch them together.
| TPayload | : | class |
| Joutsen.System.Events.AggregatingEvent< TPayload >.AggregatingEvent | ( | string | name | ) |
in derived classes creates a new instance of an event.
| name | the name of the event |
| System.ArgumentException | if the name is empty, null or consists only of wihtespace characters |
|
protectedpure virtual |
Can be used in child classes to implement the aggregation of the payload.
| newPayload | the payload of the latest event that is not aggregated yet |
| aggregatedPayload | the aggregated payload of previous calls to Fire. It combines the payloads that were aggregated during the delay. It can be null if the event was not fired since the last dispatch. |
newPayload and aggregatedPayload if they should/can be combined and dispatched together. Otherwise null.
|
virtual |
Fires the event with the payload.
| payload | the payload to send |
Reimplemented from Joutsen.System.Events.PayloadEvent< TPayload >.
|
protected |
Fires the event with the aggregated payload.
|
getset |
The time to delay firing the event in order to aggregate changes in the payload.
| System.ArgumentException | if the interval is set to a negative value |
1.8.13