private void StopCurrentTask(ILogicalDevice device, Cue.CueParts cuePart) { if (this.currentInstance == null) { return; } this.currentInstance.StopExistingTask(device, cuePart); }
public void StopExistingTask(ILogicalDevice device, Cue.CueParts cuePart) { var key = Tuple.Create(device, cuePart); Task existingTask; if (this.tasks.TryGetValue(key, out existingTask)) { // Stop existing Executor.Current.StopManagedTask(existingTask); } }
public void AddNewTask(ILogicalDevice device, Cue.CueParts cuePart, Task task, Action mibCheck = null) { var key = Tuple.Create(device, cuePart); this.tasks[key] = task; task.ContinueWith(x => { this.tasks.Remove(key); }); if (mibCheck != null) { task.ContinueWith(x => { if (!x.IsCanceled) { mibCheck(); } }); } }