TaskCompletionSource<TResult> 构造函数

定义

创建一个 TaskCompletionSource<TResult> 对象。

重载

TaskCompletionSource<TResult>()

创建一个 TaskCompletionSource<TResult>

TaskCompletionSource<TResult>(Object)

使用指定的状态创建一个 TaskCompletionSource<TResult>

TaskCompletionSource<TResult>(TaskCreationOptions)

使用指定的选项创建一个 TaskCompletionSource<TResult>

TaskCompletionSource<TResult>(Object, TaskCreationOptions)

使用指定的状态和选项创建一个 TaskCompletionSource<TResult>

TaskCompletionSource<TResult>()

Source:
TaskCompletionSource_T.cs
Source:
TaskCompletionSource_T.cs
Source:
TaskCompletionSource_T.cs
public:
 TaskCompletionSource();
public TaskCompletionSource ();
Public Sub New ()

另请参阅

适用于

TaskCompletionSource<TResult>(Object)

Source:
TaskCompletionSource_T.cs
Source:
TaskCompletionSource_T.cs
Source:
TaskCompletionSource_T.cs

使用指定的状态创建一个 TaskCompletionSource<TResult>

public:
 TaskCompletionSource(System::Object ^ state);
public TaskCompletionSource (object state);
public TaskCompletionSource (object? state);
new System.Threading.Tasks.TaskCompletionSource<'Result> : obj -> System.Threading.Tasks.TaskCompletionSource<'Result>
Public Sub New (state As Object)

参数

state
Object

要用作基础 Task<TResult> 的 AsyncState 的状态。

另请参阅

适用于

TaskCompletionSource<TResult>(TaskCreationOptions)

Source:
TaskCompletionSource_T.cs
Source:
TaskCompletionSource_T.cs
Source:
TaskCompletionSource_T.cs

使用指定的选项创建一个 TaskCompletionSource<TResult>

public:
 TaskCompletionSource(System::Threading::Tasks::TaskCreationOptions creationOptions);
public TaskCompletionSource (System.Threading.Tasks.TaskCreationOptions creationOptions);
new System.Threading.Tasks.TaskCompletionSource<'Result> : System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.TaskCompletionSource<'Result>
Public Sub New (creationOptions As TaskCreationOptions)

参数

creationOptions
TaskCreationOptions

创建基础 Task<TResult> 时要使用的选项。

例外

creationOptions 表示与 TaskCompletionSource<TResult> 一起使用时无效的选项。

注解

Task<TResult>此实例创建并通过其Task属性访问的 将使用指定的 creationOptions实例化 。

另请参阅

适用于

TaskCompletionSource<TResult>(Object, TaskCreationOptions)

Source:
TaskCompletionSource_T.cs
Source:
TaskCompletionSource_T.cs
Source:
TaskCompletionSource_T.cs

使用指定的状态和选项创建一个 TaskCompletionSource<TResult>

public:
 TaskCompletionSource(System::Object ^ state, System::Threading::Tasks::TaskCreationOptions creationOptions);
public TaskCompletionSource (object state, System.Threading.Tasks.TaskCreationOptions creationOptions);
public TaskCompletionSource (object? state, System.Threading.Tasks.TaskCreationOptions creationOptions);
new System.Threading.Tasks.TaskCompletionSource<'Result> : obj * System.Threading.Tasks.TaskCreationOptions -> System.Threading.Tasks.TaskCompletionSource<'Result>
Public Sub New (state As Object, creationOptions As TaskCreationOptions)

参数

state
Object

要用作基础 Task<TResult> 的 AsyncState 的状态。

creationOptions
TaskCreationOptions

创建基础 Task<TResult> 时要使用的选项。

例外

creationOptions 表示与 TaskCompletionSource<TResult> 一起使用时无效的选项。

另请参阅

适用于