示例#1
0
 /// <summary>
 /// 插队
 /// </summary>
 /// <param name="t"></param>
 public void Jumpqueue(TaskType t)
 {
     lock (taskQueue)
     {
         if (TaskAdding != null)
         {
             TaskAdding.Invoke(this, new TaskAddingEventArgs()
             {
                 Task = t, Index = 0
             });
         }
         taskQueue.Insert(0, t);
         if (TaskQueueChanged != null)
         {
             TaskQueueChanged.Invoke(this, null);
         }
     }
 }
示例#2
0
 /// <summary>
 /// 入队列
 /// </summary>
 /// <param name="t"></param>
 public void Enqueue(TaskType t)
 {
     lock (taskQueue)
     {
         if (TaskAdding != null)
         {
             TaskAdding.Invoke(this, new TaskAddingEventArgs()
             {
                 Task = t, Index = taskQueue.Count
             });
         }
         taskQueue.Add(t);
         if (TaskQueueChanged != null)
         {
             TaskQueueChanged.Invoke(this, null);
         }
     }
     IsTaskQueueCompleted = false;
 }