/// <summary>Asynchronously iterates through an enumerable of tasks.</summary>
 /// <param name="factory">The target factory.</param>
 /// <param name="source">The enumerable containing the tasks to be iterated through.</param>
 /// <param name="state">The asynchronous state for the returned Task.</param>
 /// <returns>A Task that represents the complete asynchronous operation.</returns>
 public static Task Iterate(
     this TaskFactory factory,
     IEnumerable <object> source, object state)
 {
     if (factory == null)
     {
         throw new ArgumentNullException(nameof(factory));
     }
     return(Iterate(factory, source, state, factory.CancellationToken, factory.CreationOptions, factory.GetTargetScheduler()));
 }
 /// <summary>Asynchronously iterates through an enumerable of tasks.</summary>
 /// <param name="factory">The target factory.</param>
 /// <param name="source">The enumerable containing the tasks to be iterated through.</param>
 /// <param name="creationOptions">Options that control the task's behavior.</param>
 /// <returns>A Task that represents the complete asynchronous operation.</returns>
 public static Task Iterate(
     this TaskFactory factory,
     IEnumerable <object> source,
     TaskCreationOptions creationOptions)
 {
     if (factory == null)
     {
         throw new ArgumentNullException("factory");
     }
     return(Iterate(factory, source, null, factory.CancellationToken, creationOptions, factory.GetTargetScheduler()));
 }
Beispiel #3
0
        /// <summary>
        /// Asynchronously iterates through an enumerable of tasks.
        /// </summary>
        /// <param name="factory">The target factory.</param>
        /// <param name="source">The enumerable containing the tasks to be iterated through.</param>
        /// <param name="state">The asynchronous state for the returned Task.</param>
        /// <returns>A Task that represents the complete asynchronous operation.</returns>
        public static Task Iterate(this TaskFactory factory, IEnumerable <object> source, object state)
        {
            Contract.Requires(factory != null);

            return(Iterate(factory, source, state, factory.CancellationToken, factory.CreationOptions, factory.GetTargetScheduler()));
        }