Class EventAggregator<T>
A class which aggregates events.
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker.Events
Assembly: GameStateTracker.Events.dll
Syntax
public class EventAggregator<T> : EventPublisher<T>, IEventAggregator<T>, IEventPublisher<T> where T : class
Type Parameters
Name | Description |
---|---|
T | The event type. |
Constructors
View SourceEventAggregator(params IEventPublisher<T>[])
Initializes a new instance of the EventAggregator<T> class.
Declaration
public EventAggregator(params IEventPublisher<T>[] publishers)
Parameters
Type | Name | Description |
---|---|---|
IEventPublisher<T>[] | publishers | The event publishers to aggregate events from. |
Properties
View SourceRecentEvents
Gets a read-only list of recent events.
Declaration
public IReadOnlyList<T> RecentEvents { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<T> |
Methods
View SourceClearEvents()
Clears the list of events.
Declaration
public void ClearEvents()
Forward<TOther>(IEventPublisher<TOther>)
Forwards events from an IEventPublisher<T> by publishing them from this event aggregator.
Declaration
public void Forward<TOther>(IEventPublisher<TOther> input) where TOther : T
Parameters
Type | Name | Description |
---|---|---|
IEventPublisher<TOther> | input | The event publisher to forward events from. |
Type Parameters
Name | Description |
---|---|
TOther | The other event type. |
Publish(object?, T)
Publishes an event.
Declaration
protected override void Publish(object? sender, T e)
Parameters
Type | Name | Description |
---|---|---|
object | sender | The event source. |
T | e | The event. |