public IProgressNotifier Spawn(double maxTicks, string startMessage = "") { ProgressNotifierReporter child = new ProgressNotifierReporter(this, maxTicks, startMessage); children.Add(child); child.Disposed += ChildOnDisposed; return(child); void ChildOnDisposed(object sender, EventArgs e) { child.Disposed -= ChildOnDisposed; children.Remove(child); } }
public ProgressNotifierReporter(ProgressNotifierReporter parent, double maxTicks, string startMessage) { this.parent = parent; this.maxTicks = maxTicks; ReportProgress(startMessage); }