Task.ConfigureAwait(Boolean) 方法

定义

配置用于等待此 Task的 awaiter。Configures an awaiter used to await this Task.

public:
 System::Runtime::CompilerServices::ConfiguredTaskAwaitable ConfigureAwait(bool continueOnCapturedContext);
public System.Runtime.CompilerServices.ConfiguredTaskAwaitable ConfigureAwait (bool continueOnCapturedContext);
member this.ConfigureAwait : bool -> System.Runtime.CompilerServices.ConfiguredTaskAwaitable
Public Function ConfigureAwait (continueOnCapturedContext As Boolean) As ConfiguredTaskAwaitable

参数

continueOnCapturedContext
Boolean

尝试将延续任务封送回原始上下文,则为 true;否则为 falsetrue to attempt to marshal the continuation back to the original context captured; otherwise, false.

返回

ConfiguredTaskAwaitable

用于的等待此任务的对象。An object used to await this task.

适用于