|
| .NET Framework Class Library |
| TaskCompletionSource<(Of <(TResult>)>)..::.SetCanceled Method |
| TaskCompletionSource<(Of <(TResult>)>) Class See Also Send Feedback |
Transitions the underlying
Task<(Of <(TResult>)>) into the
Canceled
state.
Namespace:
System.Threading.Tasks
Assembly:
System.Threading (in System.Threading.dll)
Syntax
| Visual Basic (Declaration) |
|---|
Public Sub SetCanceled |
| C# |
|---|
public void SetCanceled() |
Exceptions
| Exception | Condition |
|---|---|
| System..::.InvalidOperationException | The underlying Task<(Of <(TResult>)>) is already in one of the three final states: RanToCompletion, Faulted, or Canceled. |
| System..::.ObjectDisposedException | The Task was disposed. |