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