/// <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); } } }
/// <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; }