SetCanceled Method
Collapse the table of content
Expand the table of content

TaskCompletionSource<TResult>.SetCanceled Method

Transitions the underlying Task<TResult> into the Canceled state.

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

public void SetCanceled()

ExceptionCondition
InvalidOperationException

The underlying Task<TResult> is already in one of the three final states: RanToCompletion, Faulted, or Canceled, or if the underlying Task<TResult> has already been disposed.

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2016 Microsoft