/// <summary>
 /// Creates a continuation <see cref="Task"/> that will compplete upon
 /// the completion of a set of provided <see cref="Task"/>s.
 /// </summary>
 /// <param name="factory">The <see cref="TaskFactory"/> to use to create the continuation task.</param>
 /// <param name="tasks">The array of tasks from which to continue.</param>
 /// <returns>A <see cref="Task"/> that, when completed, will return the array of completed tasks.</returns>
 public static Task <Task <TAntecedentResult>[]> WhenAll <TAntecedentResult>(
     this TaskFactory factory, params Task <TAntecedentResult>[] tasks)
 {
     return(factory.ContinueWhenAll(tasks, completedTasks => completedTasks));
 }
 /// <summary>
 /// Creates a continuation <see cref="Task"/> that will compplete upon
 /// the completion of a set of provided <see cref="Task"/>s.
 /// </summary>
 /// <param name="factory">The <see cref="TaskFactory"/> to use to create the continuation task.</param>
 /// <param name="tasks">The array of tasks from which to continue.</param>
 /// <returns>A <see cref="Task"/> that, when completed, will return the array of completed tasks.</returns>
 public static Task <Task[]> WhenAll(
     this TaskFactory factory, params Task[] tasks)
 {
     return(factory.ContinueWhenAll(tasks, completedTasks => completedTasks));
 }
        public Task <TResult> ContinueWhenAll <TAntecedentResult>(Task <TAntecedentResult>[] tasks, Func <Task <TAntecedentResult>[], TResult> continuationFunction, TaskContinuationOptions continuationOptions)
        {
            StackCrawlMark lookForMyCaller = StackCrawlMark.LookForMyCaller;

            return(TaskFactory <TResult> .ContinueWhenAll <TAntecedentResult>(tasks, continuationFunction, continuationOptions, this.m_defaultCancellationToken, this.DefaultScheduler, ref lookForMyCaller));
        }
        public Task <TResult> ContinueWhenAll <TAntecedentResult>(Task <TAntecedentResult>[] tasks, Func <Task <TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler)
        {
            StackCrawlMark lookForMyCaller = StackCrawlMark.LookForMyCaller;

            return(TaskFactory <TResult> .ContinueWhenAll <TAntecedentResult>(tasks, continuationFunction, continuationOptions, cancellationToken, scheduler, ref lookForMyCaller));
        }
        public Task <TResult> ContinueWhenAll(Task[] tasks, Func <Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken)
        {
            StackCrawlMark lookForMyCaller = StackCrawlMark.LookForMyCaller;

            return(TaskFactory <TResult> .ContinueWhenAll(tasks, continuationFunction, this.m_defaultContinuationOptions, cancellationToken, this.DefaultScheduler, ref lookForMyCaller));
        }