Add dynamic operations change UI

This commit is contained in:
2025-11-05 16:59:39 +09:00
parent 05e24d4eae
commit 6e191f3676
5 changed files with 124 additions and 6 deletions

View File

@ -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 { }
}
}
}