public void Step(string message, int work = 1) { if (currentTask == null) { LoggingService.LogError("Task not started in progress monitor"); return; } if (work < 0) { work = 0; } ConsumePendingWork(); currentTask.Step(message, work); if (context != null) { context.Post((o) => { var(mon, msg, work1) = (ValueTuple <ProgressMonitor, string, int>)o; MonitorStep(mon, msg, work1); }, (this, message, work)); } else { MonitorStep(this, message, work); } if (followerMonitors != null) { foreach (var m in followerMonitors) { m.Step(message, work); } } void MonitorStep(ProgressMonitor mon, string msg, int work1) { mon.OnStep(msg, work1); mon.ReportProgressChanged(); } }
public void Step(string message, int work = 1) { if (currentTask == null) { LoggingService.LogError("Task not started in progress monitor"); return; } if (work < 0) { work = 0; } ConsumePendingWork(); currentTask.Step(message, work); if (context != null) { context.Post((o) => { OnStep(message, work); ReportProgressChanged(); }, null); } else { OnStep(message, work); ReportProgressChanged(); } if (followerMonitors != null) { foreach (var m in followerMonitors) { m.Step(message, work); } } }