Add dynamic operations change UI
This commit is contained in:
@ -10,6 +10,10 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
|
||||
public bool Ready { get; set; }
|
||||
|
||||
public event Action<Operation> OnOperationStarted;
|
||||
public event Action<Operation> OnOperationExecuted;
|
||||
public event Action<Operation> OnOperationEnded;
|
||||
|
||||
public void EnqueueOperation(Operation operation)
|
||||
{
|
||||
operationsInQueue.Enqueue(operation);
|
||||
@ -34,5 +38,32 @@ namespace Hcs.WebApp.BackgroundServices
|
||||
{
|
||||
return operationsInQueue.Any(x => x.CampaignId == campaignId) || operationsInProcess.Any(x => x.CampaignId == campaignId);
|
||||
}
|
||||
|
||||
public void InvokeOnOperationStarted(Operation operation)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnOperationStarted?.Invoke(operation);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public void InvokeOnOperationExecuted(Operation operation)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnOperationExecuted?.Invoke(operation);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public void InvokeOnOperationEnded(Operation operation)
|
||||
{
|
||||
try
|
||||
{
|
||||
OnOperationEnded?.Invoke(operation);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user