/// <summary> /// Starts the given Task when this Task ended successfully. /// </summary> /// <param name="followingTask">The task to start.</param> /// <returns>This task.</returns> public static Task Then(this Task that, Task followingTask) { TaskDistributor target = null; if (ThreadBase.CurrentThread is TaskWorker) { target = ((TaskWorker)ThreadBase.CurrentThread).TaskDistributor; } return(that.Then(followingTask, target)); }
/// <summary> /// Starts this Task when the other Task ended successfully. /// </summary> /// <param name="followingTask">The task to await.</param> /// <param name="target">The DispatcherBase to start this task on.</param> /// <returns>This task.</returns> public static Task Await(this Task that, Task taskToWaitFor, DispatcherBase target) { taskToWaitFor.Then(that, target); return(that); }
/// <summary> /// Starts this Task when the other Task ended successfully. /// </summary> /// <param name="followingTask">The task to await.</param> /// <returns>This task.</returns> public static Task Await(this Task that, Task taskToWaitFor) { taskToWaitFor.Then(that); return(that); }