Added TrangaTask.RemoveChildTask
This commit is contained in:
parent
8b58e7dd13
commit
93de471836
@ -76,11 +76,8 @@ public abstract class TrangaTask
|
||||
|
||||
public void ReplaceFailedChildTask(DownloadChapterTask failed, DownloadChapterTask newTask)
|
||||
{
|
||||
if (!this.childTasks.Contains(failed))
|
||||
throw new ArgumentException($"Task {failed} is not childTask of {this}");
|
||||
this.childTasks.Remove(failed);
|
||||
this.childTasks.Add(newTask);
|
||||
this.DecrementProgress(failed.progress);
|
||||
this.RemoveChildTask(failed);
|
||||
this.AddChildTask(newTask);
|
||||
}
|
||||
|
||||
public void AddChildTask(TrangaTask childTask)
|
||||
@ -88,6 +85,12 @@ public abstract class TrangaTask
|
||||
this.childTasks.Add(childTask);
|
||||
}
|
||||
|
||||
public void RemoveChildTask(TrangaTask childTask)
|
||||
{
|
||||
this.childTasks.Remove(childTask);
|
||||
this.DecrementProgress(childTask.progress);
|
||||
}
|
||||
|
||||
public void IncrementProgress(double amount)
|
||||
{
|
||||
this.lastChange = DateTime.Now;
|
||||
|
Loading…
Reference in New Issue
Block a user