Changed taskProgress increment to call method that updates progress accordingly (with parent-tasks being also updated)

This commit is contained in:
2023-06-06 20:54:21 +02:00
parent 5b4a3b9d7c
commit 17ce820cf3
4 changed files with 32 additions and 10 deletions

View File

@ -21,7 +21,7 @@ public abstract class TrangaTask
public DateTime lastExecuted { get; set; }
public Task task { get; }
[Newtonsoft.Json.JsonIgnore]public ExecutionState state { get; set; }
[Newtonsoft.Json.JsonIgnore]public float progress { get; set; }
[Newtonsoft.Json.JsonIgnore]public float progress { get; protected set; }
[Newtonsoft.Json.JsonIgnore]public DateTime nextExecution => lastExecuted.Add(reoccurrence);
public enum ExecutionState
@ -38,6 +38,12 @@ public abstract class TrangaTask
this.task = task;
this.progress = 0f;
}
public float IncrementProgress(float amount)
{
this.progress += amount;
return this.progress;
}
/// <summary>
/// BL for concrete Tasks