AsyncTaskMethodBuilder AsyncTaskMethodBuilder AsyncTaskMethodBuilder AsyncTaskMethodBuilder Struct

定義

表示非同步方法產生器,會傳回工作。Represents a builder for asynchronous methods that return a task.

public value class AsyncTaskMethodBuilder
public struct AsyncTaskMethodBuilder
type AsyncTaskMethodBuilder = struct
Public Structure AsyncTaskMethodBuilder
繼承
AsyncTaskMethodBuilderAsyncTaskMethodBuilderAsyncTaskMethodBuilderAsyncTaskMethodBuilder

備註

這個類型和其成員是供編譯器使用。This type and its members are intended for use by the compiler.

屬性

Task Task Task Task

取得此產生器的工作。Gets the task for this builder.

方法

AwaitOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine) AwaitOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine) AwaitOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine) AwaitOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine)

排程狀態機器以在指定的 awaiter 完成時繼續下一個動作。Schedules the state machine to proceed to the next action when the specified awaiter completes.

AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine) AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine) AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine) AwaitUnsafeOnCompleted<TAwaiter,TStateMachine>(TAwaiter, TStateMachine)

排程狀態機器以在指定的 awaiter 完成時繼續下一個動作。Schedules the state machine to proceed to the next action when the specified awaiter completes. 可以從部分信任程式碼呼叫這個方法。This method can be called from partially trusted code.

Create() Create() Create() Create()

建立 AsyncTaskMethodBuilder 類別的執行個體。Creates an instance of the AsyncTaskMethodBuilder class.

SetException(Exception) SetException(Exception) SetException(Exception) SetException(Exception)

將工作標示為失敗,並將指定的例外狀況繫結至工作。Marks the task as failed and binds the specified exception to the task.

SetResult() SetResult() SetResult() SetResult()

將工作標記為已成功完成。Marks the task as successfully completed.

SetStateMachine(IAsyncStateMachine) SetStateMachine(IAsyncStateMachine) SetStateMachine(IAsyncStateMachine) SetStateMachine(IAsyncStateMachine)

將產生器與指定的狀態機器產生關聯。Associates the builder with the specified state machine.

Start<TStateMachine>(TStateMachine) Start<TStateMachine>(TStateMachine) Start<TStateMachine>(TStateMachine) Start<TStateMachine>(TStateMachine)

開始執行具有相關聯狀態機器的產生器。Begins running the builder with the associated state machine.

適用於