public Task <TNewResult> ContinueWith <TNewResult> (Func <Task <TResult>, object, TNewResult> continuationFunction, object state, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) { if (continuationFunction == null) { throw new ArgumentNullException("continuationFunction"); } if (scheduler == null) { throw new ArgumentNullException("scheduler"); } var t = new Task <TNewResult> (TaskActionInvoker.Create(continuationFunction), state, cancellationToken, GetCreationOptions(continuationOptions), null, this); ContinueWithCore(t, continuationOptions, scheduler); return(t); }
public Task(Func <TResult> function, CancellationToken cancellationToken, TaskCreationOptions creationOptions) : base(TaskActionInvoker.Create(function), null, cancellationToken, creationOptions) { if (function == null) { throw new ArgumentNullException("function"); } }
public Task (Action<object> action, object state, CancellationToken cancellationToken, TaskCreationOptions creationOptions) : this (TaskActionInvoker.Create (action), state, cancellationToken, creationOptions, current) { if (action == null) throw new ArgumentNullException ("action"); if (creationOptions > MaxTaskCreationOptions || creationOptions < TaskCreationOptions.None) throw new ArgumentOutOfRangeException ("creationOptions"); }
public Task ContinueWith (Action<Task> continuationAction, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) { if (continuationAction == null) throw new ArgumentNullException ("continuationAction"); if (scheduler == null) throw new ArgumentNullException ("scheduler"); return ContinueWith (TaskActionInvoker.Create (continuationAction), cancellationToken, continuationOptions, scheduler); }
public Task(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions) : this(TaskActionInvoker.Create(action), null, cancellationToken, creationOptions, current.Get()) { if (action == null) { throw new ArgumentNullException("action"); } if (creationOptions > MaxTaskCreationOptions || creationOptions < TaskCreationOptions.None) { throw new ArgumentOutOfRangeException("creationOptions"); } }
public Task <TResult> ContinueWith <TResult> (Func <Task, TResult> continuationFunction, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) { if (continuationFunction == null) { throw new ArgumentNullException("continuationFunction"); } if (scheduler == null) { throw new ArgumentNullException("scheduler"); } return(ContinueWith <TResult> (TaskActionInvoker.Create(continuationFunction), cancellationToken, continuationOptions, scheduler)); }
Task ContinueWith (Action<Task, object> continuationAction, object state, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) { if (continuationAction == null) throw new ArgumentNullException ("continuationAction"); if (scheduler == null) throw new ArgumentNullException ("scheduler"); Task continuation = new Task (TaskActionInvoker.Create (continuationAction), state, cancellationToken, GetCreationOptions (continuationOptions), parent, this); ContinueWithCore (continuation, continuationOptions, scheduler); return continuation; }
public Task ContinueWith(Action <Task <TResult> > continuationAction, CancellationToken cancellationToken, TaskContinuationOptions continuationOptions, TaskScheduler scheduler) { if (continuationAction == null) { throw new ArgumentNullException("continuationAction"); } if (scheduler == null) { throw new ArgumentNullException("scheduler"); } Task t = new Task(TaskActionInvoker.Create(continuationAction), null, cancellationToken, GetCreationOptions(continuationOptions), this); ContinueWithCore(t, continuationOptions, scheduler); return(t); }
protected void SetAction (Action<object> action) { this.invoker = TaskActionInvoker.Create(action); }