TaskCompletionSource<TResult> Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a TaskCompletionSource<TResult> object.
TaskCompletionSource<TResult>() |
Creates a TaskCompletionSource<TResult>. |
TaskCompletionSource<TResult>(Object) |
Creates a TaskCompletionSource<TResult> with the specified state. |
TaskCompletionSource<TResult>(TaskCreationOptions) |
Creates a TaskCompletionSource<TResult> with the specified options. |
TaskCompletionSource<TResult>(Object, TaskCreationOptions) |
Creates a TaskCompletionSource<TResult> with the specified state and options. |
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
Creates a TaskCompletionSource<TResult>.
public:
TaskCompletionSource();
public TaskCompletionSource();
Public Sub New ()
See also
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
Creates a TaskCompletionSource<TResult> with the specified state.
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)
Parameters
- state
- Object
The state to use as the underlying Task<TResult>'s AsyncState.
See also
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
Creates a TaskCompletionSource<TResult> with the specified options.
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)
Parameters
- creationOptions
- TaskCreationOptions
The options to use when creating the underlying Task<TResult>.
Exceptions
The creationOptions
represent options invalid for use with a TaskCompletionSource<TResult>.
Remarks
The Task<TResult> created by this instance and accessible through its Task property will be instantiated using the specified creationOptions
.
See also
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
- Source:
- TaskCompletionSource_T.cs
Creates a TaskCompletionSource<TResult> with the specified state and options.
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)
Parameters
- state
- Object
The state to use as the underlying Task<TResult>'s AsyncState.
- creationOptions
- TaskCreationOptions
The options to use when creating the underlying Task<TResult>.
Exceptions
The creationOptions
represent options invalid for use with a TaskCompletionSource<TResult>.
See also
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: