Task Property
Collapse the table of content
Expand the table of content

TaskCompletionSource<TResult>.Task Property

 
Namespace:   System.Threading.Tasks
Assembly:  mscorlib (in mscorlib.dll)

public Task<TResult> Task { get; }

Property Value

Type: System.Threading.Tasks.Task<TResult>

Returns the Task<TResult> created by this TaskCompletionSource<TResult>.

This property enables a consumer to access the Task<TResult> that is controlled by this instance. When you create a TaskCompletionSource<TResult> object, the Status property of this Task<TResult> object returns WaitingForActivation

The SetResult, SetException, SetException, and SetCanceled methods (and their "Try" variants) on this instance all result in the relevant state transitions on this underlying Task.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 5.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft