Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
 /// <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);
 }
Ejemplo n.º 3
0
 /// <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);
 }