예제 #1
0
        private void StopCurrentTask(ILogicalDevice device, Cue.CueParts cuePart)
        {
            if (this.currentInstance == null)
            {
                return;
            }

            this.currentInstance.StopExistingTask(device, cuePart);
        }
예제 #2
0
            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);
                }
            }
예제 #3
0
            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();
                        }
                    });
                }
            }