Add events aggregator
This commit is contained in:
22
Hcs.WebApp/BackgroundServices/EventsAggregator.cs
Normal file
22
Hcs.WebApp/BackgroundServices/EventsAggregator.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using Hcs.WebApp.Data.Hcs;
|
||||
|
||||
namespace Hcs.WebApp.BackgroundServices
|
||||
{
|
||||
public class EventsAggregator
|
||||
{
|
||||
public event Action<Operation> OnOperationCreated;
|
||||
public event OperationStarted OnOperationStarted;
|
||||
public event OperationExecuted OnOperationExecuted;
|
||||
public event OperationEnded OnOperationEnded;
|
||||
|
||||
public EventsAggregator(OperationExecutionState operationExecutionState, ResultGetState resultGetState)
|
||||
{
|
||||
operationExecutionState.OnOperationCreated += (a) => OnOperationCreated?.Invoke(a);
|
||||
operationExecutionState.OnOperationStarted += (a, b, c) => OnOperationStarted?.Invoke(a, b, c);
|
||||
operationExecutionState.OnOperationExecuted += (a, b, c) => OnOperationExecuted?.Invoke(a, b, c);
|
||||
operationExecutionState.OnOperationEnded += (a, b, c, d) => OnOperationEnded?.Invoke(a, b, c, d);
|
||||
|
||||
resultGetState.OnOperationEnded += (a, b, c, d) => OnOperationEnded?.Invoke(a, b, c, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user