示例#1
0
        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);
                }
            }
        }
示例#2
0
 /// <summary>
 /// 執行工作完成時,所需執行的工作
 /// </summary>
 /// <param name="e"></param>
 public abstract void OnWorkFinished(object sender, WorkFinishedEventArgs e);
示例#3
0
 /// <summary>
 /// 執行工作完成時,所需執行的工作
 /// </summary>
 /// <param name="e"></param>
 public abstract void OnWorkFinished(object sender, WorkFinishedEventArgs e);
示例#4
0
 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);
     }
 }