private void DoWork(int _taskId, object data) { //Console.WriteLine("開始執行第" + i + "個 sub task.... 10 秒"); WorkStartingEventArgs s = new WorkStartingEventArgs(_taskId, data); OnWorkStarting(this, s); WorkFinishedEventArgs e = new WorkFinishedEventArgs(_taskId, data); OnWorkFinished(this, e); //Console.WriteLine("第" + i + "個 sub task 結束了"); if (TaskPool != null) { if (TaskPool.ContainsKey(_taskId)) { TaskPool.Remove(_taskId); } } }
/// <summary> /// 執行工作完成時,所需執行的工作 /// </summary> /// <param name="e"></param> public abstract void OnWorkFinished(object sender, WorkFinishedEventArgs e);
private void DoWork(int _taskId, object data) { //Console.WriteLine("開始執行第" + i + "個 sub task.... 10 秒"); WorkStartingEventArgs s = new WorkStartingEventArgs(_taskId, data); OnWorkStarting(this, s); WorkFinishedEventArgs e = new WorkFinishedEventArgs(_taskId, data); OnWorkFinished(this, e); //Console.WriteLine("第" + i + "個 sub task 結束了"); if (TaskPool != null) { if (TaskPool.ContainsKey(_taskId)) TaskPool.Remove(_taskId); } }