TaskAwaiter<TResult> TaskAwaiter<TResult> TaskAwaiter<TResult> TaskAwaiter<TResult> Struct

定義

表示等候非同步工作完成,並提供結果參數的物件。Represents an object that waits for the completion of an asynchronous task and provides a parameter for the result.

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

generic <typename TResult>
public value class TaskAwaiter : System::Runtime::CompilerServices::ICriticalNotifyCompletion
public struct TaskAwaiter<TResult> : System.Runtime.CompilerServices.ICriticalNotifyCompletion
type TaskAwaiter<'Result> = struct
    interface ICriticalNotifyCompletion
    interface INotifyCompletion
Public Structure TaskAwaiter(Of TResult)
Implements ICriticalNotifyCompletion

類型參數

TResult

工作的結果。The result for the task.

繼承
TaskAwaiter<TResult>TaskAwaiter<TResult>TaskAwaiter<TResult>TaskAwaiter<TResult>
實作

備註

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

屬性

IsCompleted IsCompleted IsCompleted IsCompleted

取得值,指出非同步工作是否已經完成。Gets a value that indicates whether the asynchronous task has completed.

方法

GetResult() GetResult() GetResult() GetResult()

結束對非同步工作完成的等候。Ends the wait for the completion of the asynchronous task.

OnCompleted(Action) OnCompleted(Action) OnCompleted(Action) OnCompleted(Action)

設定 TaskAwaiter<TResult> 物件停止等待非同步工作完成時要執行時的動作。Sets the action to perform when the TaskAwaiter<TResult> object stops waiting for the asynchronous task to complete.

UnsafeOnCompleted(Action) UnsafeOnCompleted(Action) UnsafeOnCompleted(Action) UnsafeOnCompleted(Action)

排程此 awaiter 相關聯的非同步工作的接續動作。Schedules the continuation action for the asynchronous task associated with this awaiter.

適用於