TaskAwaiter.OnCompleted(Action) 方法

定义

将操作设置为当 TaskAwaiter 对象停止等待异步任务完成时执行。Sets the action to perform when the TaskAwaiter object stops waiting for the asynchronous task to complete.

此 API 支持产品基础结构,不能在代码中直接使用。

public:
 virtual void OnCompleted(Action ^ continuation);
public void OnCompleted (Action continuation);
abstract member OnCompleted : Action -> unit
override this.OnCompleted : Action -> unit
Public Sub OnCompleted (continuation As Action)

参数

continuation
Action

在等待操作完成时要执行的操作。The action to perform when the wait operation completes.

实现

例外

continuationnullcontinuation is null.

TaskAwaiter 对象未正确初始化。The TaskAwaiter object was not properly initialized.

awaiter 未正确地初始化。The awaiter was not properly initialized.

注解

此类型及其成员旨在供编译器使用。This type and its members are intended for use by the compiler.

适用于