TaskFactory<TResult>.ContinueWhenAll 方法

定義

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

多載

ContinueWhenAll(Task[], Func<Task[],TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided Tasks.

ContinueWhenAll(Task[], Func<Task[],TResult>, TaskContinuationOptions)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided Tasks.

ContinueWhenAll(Task[], Func<Task[],TResult>)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

ContinueWhenAll(Task[], Func<Task[],TResult>, CancellationToken)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, CancellationToken)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, TaskContinuationOptions)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

ContinueWhenAll(Task[], Func<Task[],TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided Tasks.

public:
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task ^> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken, System::Threading::Tasks::TaskContinuationOptions continuationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task[],TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.ContinueWhenAll : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task[], 'Result> * System.Threading.CancellationToken * System.Threading.Tasks.TaskContinuationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task<'Result>

參數

tasks
Task[]

要接續之工作的所在陣列。The array of tasks from which to continue.

continuationFunction
Func<Task[],TResult>

tasks 陣列中的所有工作都已經完成時,要以非同步方式執行的函式委派。The function delegate to execute asynchronously when all tasks in the tasks array have completed.

cancellationToken
CancellationToken

要指派給新接續工作的取消語彙基元。The cancellation token that will be assigned to the new continuation task.

continuationOptions
TaskContinuationOptions

其中一個列舉值,這些值會控制已建立之接續工作的行為。One of the enumeration values that controls the behavior of the created continuation task. NotOn*OnlyOn* 值無效。The NotOn* and OnlyOn* values are not valid.

scheduler
TaskScheduler

用來排定所建立之接續工作的排程器。The scheduler that is used to schedule the created continuation task.

傳回

新的接續工作。The new continuation task.

例外狀況

tasks 陣列為 nullThe tasks array is null.

-或--or- continuationFunction 引數為 nullThe continuationFunction argument is null.

-或--or- scheduler 引數為 nullThe scheduler argument is null.

tasks 陣列包含 null 值或為空白。The tasks array contains a null value or is empty.

continuationOptions 指定了無效的值。continuationOptions specifies an invalid value.

tasks陣列中的其中一個項目已經過處置。One of the elements in the tasks array has been disposed.

-或--or- 已處置建立 CancellationTokenSourcecancellationTokenThe CancellationTokenSource that created cancellationToken has already been disposed.

備註

完成之後,工作會處於下列其中一種狀態: [RanToCompletion]、[Faulted] 或 [Canceled 狀態]。After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.

另請參閱

ContinueWhenAll(Task[], Func<Task[],TResult>, TaskContinuationOptions)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided Tasks.

public:
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task ^> ^, TResult> ^ continuationFunction, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task[],TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
member this.ContinueWhenAll : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task[], 'Result> * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll (tasks As Task(), continuationFunction As Func(Of Task(), TResult), continuationOptions As TaskContinuationOptions) As Task(Of TResult)

參數

tasks
Task[]

要接續之工作的所在陣列。The array of tasks from which to continue.

continuationFunction
Func<Task[],TResult>

tasks 陣列中的所有工作都已經完成時,要以非同步方式執行的函式委派。The function delegate to execute asynchronously when all tasks in the tasks array have completed.

continuationOptions
TaskContinuationOptions

其中一個列舉值,這些值會控制已建立之接續工作的行為。One of the enumeration values that controls the behavior of the created continuation task. NotOn*OnlyOn* 值無效。The NotOn* and OnlyOn* values are not valid.

傳回

新的接續工作。The new continuation task.

例外狀況

tasks陣列中的其中一個項目已經過處置。One of the elements in the tasks array has been disposed.

tasks 陣列為 nullThe tasks array is null.

-或--or- continuationFunction 引數為 nullThe continuationFunction argument is null.

continuationOptions 引數指定了無效的值。The continuationOptions argument specifies an invalid value.

tasks 陣列包含 null 值或為空白。The tasks array contains a null value or is empty.

備註

完成之後,工作會處於下列其中一種狀態: [RanToCompletion]、[Faulted] 或 [Canceled 狀態]。After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.

另請參閱

ContinueWhenAll(Task[], Func<Task[],TResult>)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

public:
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task ^> ^, TResult> ^ continuationFunction);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task[],TResult> continuationFunction);
member this.ContinueWhenAll : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task[], 'Result> -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll (tasks As Task(), continuationFunction As Func(Of Task(), TResult)) As Task(Of TResult)

參數

tasks
Task[]

要接續之工作的所在陣列。The array of tasks from which to continue.

continuationFunction
Func<Task[],TResult>

tasks 陣列中的所有工作都已經完成時,要以非同步方式執行的函式委派。The function delegate to execute asynchronously when all tasks in the tasks array have completed.

傳回

新的接續工作。The new continuation task.

例外狀況

tasks陣列中的其中一個項目已經過處置。One of the elements in the tasks array has been disposed.

tasks 陣列為 nulltasks array is null.

-或--or- continuationFunctionnullThe continuationFunction is null.

tasks 陣列包含 null 值或為空白。The tasks array contains a null value or is empty.

備註

完成之後,工作會處於下列其中一種狀態: [RanToCompletion]、[Faulted] 或 [Canceled 狀態]。After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.

另請參閱

ContinueWhenAll(Task[], Func<Task[],TResult>, CancellationToken)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

public:
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task ^> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll (System.Threading.Tasks.Task[] tasks, Func<System.Threading.Tasks.Task[],TResult> continuationFunction, System.Threading.CancellationToken cancellationToken);
member this.ContinueWhenAll : System.Threading.Tasks.Task[] * Func<System.Threading.Tasks.Task[], 'Result> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>

參數

tasks
Task[]

要接續之工作的所在陣列。The array of tasks from which to continue.

continuationFunction
Func<Task[],TResult>

tasks 陣列中的所有工作都已經完成時,要以非同步方式執行的函式委派。The function delegate to execute asynchronously when all tasks in the tasks array have completed.

cancellationToken
CancellationToken

要指派給新接續工作的取消語彙基元。The cancellation token that will be assigned to the new continuation task.

傳回

新的接續工作。The new continuation task.

例外狀況

tasks陣列中的其中一個項目已經過處置。One of the elements in the tasks array has been disposed.

-或--or- 已處置建立 CancellationTokenSourcecancellationTokenThe CancellationTokenSource that created cancellationToken has already been disposed.

tasks 陣列為 nullThe tasks array is null.

-或--or- continuationFunctionnullcontinuationFunction is null.

tasks 陣列包含 null 值或為空白。The tasks array contains a null value or is empty.

備註

完成之後,工作會處於下列其中一種狀態: [RanToCompletion]、[Faulted] 或 [Canceled 狀態]。After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.

另請參閱

ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

public:
generic <typename TAntecedentResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^, TResult> ^ continuationFunction);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>[],TResult> continuationFunction);
member this.ContinueWhenAll : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>[], 'Result> -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll(Of TAntecedentResult) (tasks As Task(Of TAntecedentResult)(), continuationFunction As Func(Of Task(Of TAntecedentResult)(), TResult)) As Task(Of TResult)

類型參數

TAntecedentResult

前項 tasks 的結果類型。The type of the result of the antecedent tasks.

參數

tasks
Task<TAntecedentResult>[]

要接續之工作的所在陣列。The array of tasks from which to continue.

continuationFunction
Func<Task<TAntecedentResult>[],TResult>

tasks 陣列中的所有工作都已經完成時,要以非同步方式執行的函式委派。The function delegate to execute asynchronously when all tasks in the tasks array have completed.

傳回

新的接續工作。The new continuation task.

例外狀況

tasks陣列中的其中一個項目已經過處置。One of the elements in the tasks array has been disposed.

tasks 陣列為 nullThe tasks array is null.

-或--or- continuationFunction 引數為 nullThe continuationFunction argument is null.

tasks 陣列包含 null 值或為空白。The tasks array contains a null value or is empty.

備註

完成之後,工作會處於下列其中一種狀態: [RanToCompletion]、[Faulted] 或 [Canceled 狀態]。After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.

另請參閱

ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, CancellationToken)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

public:
generic <typename TAntecedentResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>[],TResult> continuationFunction, System.Threading.CancellationToken cancellationToken);
member this.ContinueWhenAll : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>[], 'Result> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>

類型參數

TAntecedentResult

前項 tasks 的結果類型。The type of the result of the antecedent tasks.

參數

tasks
Task<TAntecedentResult>[]

要接續之工作的所在陣列。The array of tasks from which to continue.

continuationFunction
Func<Task<TAntecedentResult>[],TResult>

tasks 陣列中的所有工作都已經完成時,要以非同步方式執行的函式委派。The function delegate to execute asynchronously when all tasks in the tasks array have completed.

cancellationToken
CancellationToken

要指派給新接續工作的取消語彙基元。The cancellation token that will be assigned to the new continuation task.

傳回

新的接續工作。The new continuation task.

例外狀況

tasks陣列中的其中一個項目已經過處置。One of the elements in the tasks array has been disposed.

-或--or- 已處置建立 CancellationTokenSourcecancellationTokenThe CancellationTokenSource that created cancellationToken has already been disposed.

tasks 陣列為 nullThe tasks array is null.

-或--or- continuationFunction 引數為 nullThe continuationFunction argument is null.

tasks 陣列包含 null 值或為空白。The tasks array contains a null value or is empty.

備註

完成之後,工作會處於下列其中一種狀態: [RanToCompletion]、[Faulted] 或 [Canceled 狀態]。After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.

另請參閱

ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, TaskContinuationOptions)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

public:
generic <typename TAntecedentResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^, TResult> ^ continuationFunction, System::Threading::Tasks::TaskContinuationOptions continuationOptions);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>[],TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions);
member this.ContinueWhenAll : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>[], 'Result> * System.Threading.Tasks.TaskContinuationOptions -> System.Threading.Tasks.Task<'Result>
Public Function ContinueWhenAll(Of TAntecedentResult) (tasks As Task(Of TAntecedentResult)(), continuationFunction As Func(Of Task(Of TAntecedentResult)(), TResult), continuationOptions As TaskContinuationOptions) As Task(Of TResult)

類型參數

TAntecedentResult

前項 tasks 的結果類型。The type of the result of the antecedent tasks.

參數

tasks
Task<TAntecedentResult>[]

要接續之工作的所在陣列。The array of tasks from which to continue.

continuationFunction
Func<Task<TAntecedentResult>[],TResult>

tasks 陣列中的所有工作都已經完成時,要以非同步方式執行的函式委派。The function delegate to execute asynchronously when all tasks in the tasks array have completed.

continuationOptions
TaskContinuationOptions

其中一個列舉值,這些值會控制已建立之接續工作的行為。One of the enumeration values that controls the behavior of the created continuation task. NotOn*OnlyOn* 值無效。The NotOn* and OnlyOn* values are not valid.

傳回

新的接續工作。The new continuation task.

例外狀況

tasks陣列中的其中一個項目已經過處置。One of the elements in the tasks array has been disposed.

tasks 陣列為 nullThe tasks array is null.

-或--or- continuationFunction 引數為 nullThe continuationFunction argument is null.

continuationOptions 引數指定了無效的值。The continuationOptions argument specifies an invalid value.

tasks 陣列包含 null 值或為空白。The tasks array contains a null value or is empty.

備註

完成之後,工作會處於下列其中一種狀態: [RanToCompletion]、[Faulted] 或 [Canceled 狀態]。After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.

另請參閱

ContinueWhenAll<TAntecedentResult>(Task<TAntecedentResult>[], Func<Task<TAntecedentResult>[],TResult>, CancellationToken, TaskContinuationOptions, TaskScheduler)

建立會在提供的一組工作完成時啟動的接續工作。Creates a continuation task that will be started upon the completion of a set of provided tasks.

public:
generic <typename TAntecedentResult>
 System::Threading::Tasks::Task<TResult> ^ ContinueWhenAll(cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^ tasks, Func<cli::array <System::Threading::Tasks::Task<TAntecedentResult> ^> ^, TResult> ^ continuationFunction, System::Threading::CancellationToken cancellationToken, System::Threading::Tasks::TaskContinuationOptions continuationOptions, System::Threading::Tasks::TaskScheduler ^ scheduler);
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult> (System.Threading.Tasks.Task<TAntecedentResult>[] tasks, Func<System.Threading.Tasks.Task<TAntecedentResult>[],TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
member this.ContinueWhenAll : System.Threading.Tasks.Task<'AntecedentResult>[] * Func<System.Threading.Tasks.Task<'AntecedentResult>[], 'Result> * System.Threading.CancellationToken * System.Threading.Tasks.TaskContinuationOptions * System.Threading.Tasks.TaskScheduler -> System.Threading.Tasks.Task<'Result>

類型參數

TAntecedentResult

前項 tasks 的結果類型。The type of the result of the antecedent tasks.

參數

tasks
Task<TAntecedentResult>[]

要接續之工作的所在陣列。The array of tasks from which to continue.

continuationFunction
Func<Task<TAntecedentResult>[],TResult>

tasks 陣列中的所有工作都已經完成時,要以非同步方式執行的函式委派。The function delegate to execute asynchronously when all tasks in the tasks array have completed.

cancellationToken
CancellationToken

要指派給新接續工作的取消語彙基元。The cancellation token that will be assigned to the new continuation task.

continuationOptions
TaskContinuationOptions

其中一個列舉值,這些值會控制已建立之接續工作的行為。One of the enumeration values that controls the behavior of the created continuation task. NotOn*OnlyOn* 值無效。The NotOn* and OnlyOn* values are not valid.

scheduler
TaskScheduler

用來排定所建立之接續工作的排程器。The scheduler that is used to schedule the created continuation task.

傳回

新的接續工作。The new continuation task.

例外狀況

tasks 陣列為 nullThe tasks array is null.

-或--or- continuationFunction 引數為 nullThe continuationFunction argument is null.

-或--or- scheduler 引數為 nullThe scheduler argument is null.

tasks 陣列包含 null 值或為空白。The tasks array contains a null value or is empty.

continuationOptions 引數指定了無效的值。The continuationOptions argument specifies an invalid value.

tasks陣列中的其中一個項目已經過處置。One of the elements in the tasks array has been disposed.

-或--or- 已處置建立 CancellationTokenSourcecancellationTokenThe CancellationTokenSource that created cancellationToken has already been disposed.

備註

完成之後,工作會處於下列其中一種狀態: [RanToCompletion]、[Faulted] 或 [Canceled 狀態]。After completion, a task is in one of these states: RanToCompletion, Faulted, or Canceled states.

另請參閱

適用於