public void Convert(TaskSetup setup) { var task = new OfficeTask(setup); task.TaskFinishedCallback += () => TaskFinished(setup); task.ConvertFinishedEvent += ConvertFinished; task.ConvertProgressEvent += ConvertProgress; _queue.EnqueueTask(task); }
public void EnqueueTask(OfficeTask task) { lock (_lockObj) { task.TaskFinishedCallback += new Action(NextTask); task.TaskFinishedCallback += new Action(OnTaskCompleted); _tasks.Enqueue(task); ++_queuedTasksCount; } if (!_isEnabled || CurrrentStatus != QueueStatus.NoTasks) { return; } NextTask(); }