Added ProgressToken state Cancelled

This commit is contained in:
2023-09-02 14:45:46 +02:00
parent 37cf47bc17
commit 0b77dc1172
3 changed files with 23 additions and 2 deletions

View File

@ -59,13 +59,15 @@ public abstract class Job : GlobalBase
public void ResetProgress()
{
this.progressToken = new ProgressToken(this.progressToken.increments);
this.lastExecution = DateTime.Now;
}
public void Cancel()
{
Log($"Cancelling {this}");
this.progressToken.cancellationRequested = true;
this.progressToken.Complete();
this.progressToken.Cancel();
this.lastExecution = DateTime.Now;
if(subJobs is not null)
foreach(Job subJob in subJobs)
subJob.Cancel();