// set progress from 0-100 public void SetProgressDone(double done, string workingOn) { lock (this) { PercInfo last = this.PercInfos.Last(); if (last != null) { last.Done = done; last.WorkingOn = workingOn; } } }
// sum ratios in one function should be 1 public void SetProgressRatio(double ratio, string workingOn) { lock (this) { PercInfo last = this.PercInfos.Last(); if (last != null) { last.Ratio = ratio; last.WorkingOn = workingOn; } } }
public void RemoveProgress() { lock (this) { PercInfo lastRemoved = this.PercInfos.Last(); this.PercInfos.RemoveLast(); PercInfo last = this.PercInfos.Last(); if (last != null) { last.Done += last.Ratio * lastRemoved.Done; } } }