TaskCompletionSource<TResult>.SetResult(TResult) TaskCompletionSource<TResult>.SetResult(TResult) TaskCompletionSource<TResult>.SetResult(TResult) TaskCompletionSource<TResult>.SetResult(TResult) Method

定義

基になる Task<TResult>RanToCompletion 状態へ遷移させます。Transitions the underlying Task<TResult> into the RanToCompletion state.

public:
 void SetResult(TResult result);
public void SetResult (TResult result);
member this.SetResult : 'Result -> unit
Public Sub SetResult (result As TResult)

パラメーター

result

この Task<TResult> に関連付ける結果値。The result value to bind to this Task<TResult>.

例外

基になる Task<TResult> が既に次の 3 つの最終状態のいずれかです: RanToCompletionFaulted、または CanceledThe underlying Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled.

適用対象

こちらもご覧ください