C# 클래스 AsyncDolls.TaskCompletionSource

Represents the producer side of a System.Threading.Tasks.Task unbound to a delegate, providing access to the consumer side through the Task property.
파일 보기 프로젝트 열기: danielmarbach/async-dolls 1 사용 예제들

공개 메소드들

메소드 설명
SetCanceled ( ) : void

Transitions the underlying Task into the TaskStatus.Canceled state.

SetException ( Exception exception ) : void

Transitions the underlying Task into the TaskStatus.Faulted state.

SetException ( IEnumerable exceptions ) : void

Transitions the underlying Task into the TaskStatus.Faulted state.

SetResult ( ) : void

Transitions the underlying Task into the TaskStatus.RanToCompletion state.

TaskCompletionSource ( ) : System

Initializes a new instance of the TaskCompletionSource class.

TaskCompletionSource ( TaskCreationOptions creationOptions ) : System

Initializes a new instance of the TaskCompletionSource class with the specified options.

TaskCompletionSource ( object state ) : System

Initializes a new instance of the TaskCompletionSource class with the specified state.

TaskCompletionSource ( object state, TaskCreationOptions creationOptions ) : System

Initializes a new instance of the TaskCompletionSource class with the specified state and options.

TrySetCanceled ( ) : bool

Attempts to transition the underlying Task into the TaskStatus.Canceled state.

TrySetException ( Exception exception ) : bool

Attempts to transition the underlying Task into the TaskStatus.Faulted state.

TrySetException ( IEnumerable exceptions ) : bool

Attempts to transition the underlying Task into the TaskStatus.Faulted state.

TrySetResult ( ) : bool

Attempts to transition the underlying Task into the TaskStatus.RanToCompletion state.

메소드 상세

SetCanceled() 공개 메소드

Transitions the underlying Task into the TaskStatus.Canceled state.
The underlying has already been completed.
public SetCanceled ( ) : void
리턴 void

SetException() 공개 메소드

Transitions the underlying Task into the TaskStatus.Faulted state.
The underlying has already been completed.
public SetException ( Exception exception ) : void
exception System.Exception The exception to bind to this . May not be null.
리턴 void

SetException() 공개 메소드

Transitions the underlying Task into the TaskStatus.Faulted state.
The underlying has already been completed.
public SetException ( IEnumerable exceptions ) : void
exceptions IEnumerable The collection of exceptions to bind to this . May not be null or contain null elements.
리턴 void

SetResult() 공개 메소드

Transitions the underlying Task into the TaskStatus.RanToCompletion state.
The underlying has already been completed.
public SetResult ( ) : void
리턴 void

TaskCompletionSource() 공개 메소드

Initializes a new instance of the TaskCompletionSource class.
public TaskCompletionSource ( ) : System
리턴 System

TaskCompletionSource() 공개 메소드

Initializes a new instance of the TaskCompletionSource class with the specified options.
public TaskCompletionSource ( TaskCreationOptions creationOptions ) : System
creationOptions TaskCreationOptions The options to use when creating the underlying .
리턴 System

TaskCompletionSource() 공개 메소드

Initializes a new instance of the TaskCompletionSource class with the specified state.
public TaskCompletionSource ( object state ) : System
state object The state to use as the underlying 's .
리턴 System

TaskCompletionSource() 공개 메소드

Initializes a new instance of the TaskCompletionSource class with the specified state and options.
public TaskCompletionSource ( object state, TaskCreationOptions creationOptions ) : System
state object The state to use as the underlying 's .
creationOptions TaskCreationOptions The options to use when creating the underlying .
리턴 System

TrySetCanceled() 공개 메소드

Attempts to transition the underlying Task into the TaskStatus.Canceled state.
public TrySetCanceled ( ) : bool
리턴 bool

TrySetException() 공개 메소드

Attempts to transition the underlying Task into the TaskStatus.Faulted state.
public TrySetException ( Exception exception ) : bool
exception System.Exception The exception to bind to this . May not be null.
리턴 bool

TrySetException() 공개 메소드

Attempts to transition the underlying Task into the TaskStatus.Faulted state.
public TrySetException ( IEnumerable exceptions ) : bool
exceptions IEnumerable The collection of exceptions to bind to this . May not be null or contain null elements.
리턴 bool

TrySetResult() 공개 메소드

Attempts to transition the underlying Task into the TaskStatus.RanToCompletion state.
public TrySetResult ( ) : bool
리턴 bool