protected virtual void OnWorkFinished(ProgressFinishedEventArgs e) { if (WorkFinished != null) { System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(WorkFinished, this, e); } }
private void ProgressService_OnProgressFinished(object sender, ProgressFinishedEventArgs e) { var succeedCount = e.Steps - (e.Steps - (e.CurrentStep + 1)) - e.FailedSteps; Tools.Output += string.Format( "Operation finished : {0} Total, {1} Succeed, {2} Failed.\n\n", e.Steps, succeedCount, e.FailedSteps); _progressService.WorkFinished -= ProgressService_OnProgressFinished; }
public void EndWork() { var eventArgs = new ProgressFinishedEventArgs() { Steps = _steps, CurrentStep = _currentStep, FailedSteps = _failedSteps }; if (!IsFinished) OnWorkFinished(eventArgs); }
public void EndWork() { var eventArgs = new ProgressFinishedEventArgs() { Steps = _steps, CurrentStep = _currentStep, FailedSteps = _failedSteps }; if (!IsFinished) { OnWorkFinished(eventArgs); } }
public void NextStep() { var lastStep = _steps - 1; if (_currentStep < lastStep) { _currentStep++; } else { throw new Exception("Progress is finished!!"); } if (IsFinished) { var eventArgs = new ProgressFinishedEventArgs() { Steps = _steps, CurrentStep = _currentStep, FailedSteps = _failedSteps }; OnWorkFinished(eventArgs); } }
protected virtual void OnWorkFinished(ProgressFinishedEventArgs e) { if (WorkFinished != null) System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(WorkFinished, this, e); }
private void ProgressService_OnWorkFinished(object sender, ProgressFinishedEventArgs e) { OnWorkFinished(e); _lastWork.WorkFinished -= ProgressService_OnWorkFinished; }
public void NextStep() { var lastStep = _steps - 1; if (_currentStep < lastStep) _currentStep++; else throw new Exception("Progress is finished!!"); if (IsFinished) { var eventArgs = new ProgressFinishedEventArgs() { Steps = _steps, CurrentStep = _currentStep, FailedSteps = _failedSteps }; OnWorkFinished(eventArgs); } }