อ่านในภาษาอังกฤษ แก้ไข

แชร์ผ่าน


TaskCompletionSource.TrySetResult Method

Definition

Attempts to transition the underlying Task into the RanToCompletion state.

C#
public bool TrySetResult();

Returns

true if the operation was successful; otherwise, false.

Remarks

This operation will return false if the Task is already in one of the three final states: RanToCompletion, Faulted, or Canceled.

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET 5, 6, 7, 8, 9, 10