void WorkerRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { BaseBindingSource.ResumeAll(); if (!Disposing) { var timeSpan = DateTime.Now - chronoStart; timeSpent.UpdateText("done (" + (int)timeSpan.TotalSeconds + "s " + timeSpan.Milliseconds + "ms)"); MainForm.This.Activate(); } if (works.Count == 0) { if (!Disposing && progress != null && !progress.IsDisposed) { progress.UpdateVisible(false); } if (!Disposing && state != null && !state.IsDisposed) { state.UpdateText(ReadyText); } } else { StartWork(works.Dequeue()); } }
void StartWork(WorkArgument workArgument) { if (!Disposing && state != null && !state.IsDisposed) { state.UpdateText(workArgument.WorkName); } if (!Disposing && progress != null && !progress.IsDisposed) { progress.UpdateVisible(true); } BaseBindingSource.SuspendAll(); worker.RunWorkerAsync(workArgument); }