private static void CheckNext(TaskInfo obj) { taskrunning = false; if (Finished != null && obj != null) Finished(obj); if (pending.Count > 0) { taskrunning = true; TaskInfo info = pending.Dequeue(); info.Task.ContinueWith(() => CheckNext(info)); info.Task.Start(); if (Started != null) Started(info); } }
private void taskstarted(TaskInfo obj) { try { Invoke(new MethodInvoker(() => { statLabel.Text = obj.Label; if (obj.ShowProg) { progBar.Visible = true; progBarTimer.Start(); } })); } catch { /* Disposed */} }
private void taskfinished(TaskInfo obj) { try { Invoke(new MethodInvoker(() => { progBar.Visible = false; progBarTimer.Stop(); statLabel.Text = TaskManager.defaultLabel; })); } catch { /* Disposed */} }