C# 클래스 AsyncDolls.AsyncCountdownEvent

파일 보기 프로젝트 열기: danielmarbach/async-dolls 1 사용 예제들

공개 메소드들

메소드 설명
AddCount ( ) : void

Attempts to add one to the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be greater than Int32.MaxValue.

AddCount ( int signalCount ) : void

Attempts to add the specified value to the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be greater than Int32.MaxValue.

AsyncCountdownEvent ( int count ) : System

Creates an async-compatible countdown event.

Signal ( ) : void

Attempts to subtract one from the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be less than zero.

Signal ( int signalCount ) : void

Attempts to subtract the specified value from the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be less than zero.

TryAddCount ( ) : bool

Attempts to add one to the current count. This method returns false if the count is already at zero or if the new count would be greater than Int32.MaxValue.

TryAddCount ( int signalCount ) : bool

Attempts to add the specified value to the current count. This method returns false if the count is already at zero or if the new count would be greater than Int32.MaxValue.

TrySignal ( ) : bool

Attempts to subtract one from the current count. This method returns false if the count is already at zero or if the new count would be less than zero.

TrySignal ( int signalCount ) : bool

Attempts to subtract the specified value from the current count. This method returns false if the count is already at zero or if the new count would be less than zero.

Wait ( ) : void

Synchronously waits for this event to be set. This method may block the calling thread.

Wait ( CancellationToken cancellationToken ) : void

Synchronously waits for this event to be set. This method may block the calling thread.

WaitAsync ( ) : Task

Asynchronously waits for this event to be set.

비공개 메소드들

메소드 설명
ModifyCount ( int signalCount ) : bool

Attempts to modify the current count by the specified amount. This method returns false if the new current count value would be invalid, or if the count has already reached zero.

메소드 상세

AddCount() 공개 메소드

Attempts to add one to the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be greater than Int32.MaxValue.
public AddCount ( ) : void
리턴 void

AddCount() 공개 메소드

Attempts to add the specified value to the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be greater than Int32.MaxValue.
public AddCount ( int signalCount ) : void
signalCount int The amount to change the current count. This must be greater than zero.
리턴 void

AsyncCountdownEvent() 공개 메소드

Creates an async-compatible countdown event.
public AsyncCountdownEvent ( int count ) : System
count int The number of signals this event will need before it becomes set. Must be greater than zero.
리턴 System

Signal() 공개 메소드

Attempts to subtract one from the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be less than zero.
public Signal ( ) : void
리턴 void

Signal() 공개 메소드

Attempts to subtract the specified value from the current count. This method throws InvalidOperationException if the count is already at zero or if the new count would be less than zero.
public Signal ( int signalCount ) : void
signalCount int The amount to change the current count. This must be greater than zero.
리턴 void

TryAddCount() 공개 메소드

Attempts to add one to the current count. This method returns false if the count is already at zero or if the new count would be greater than Int32.MaxValue.
public TryAddCount ( ) : bool
리턴 bool

TryAddCount() 공개 메소드

Attempts to add the specified value to the current count. This method returns false if the count is already at zero or if the new count would be greater than Int32.MaxValue.
public TryAddCount ( int signalCount ) : bool
signalCount int The amount to change the current count. This must be greater than zero.
리턴 bool

TrySignal() 공개 메소드

Attempts to subtract one from the current count. This method returns false if the count is already at zero or if the new count would be less than zero.
public TrySignal ( ) : bool
리턴 bool

TrySignal() 공개 메소드

Attempts to subtract the specified value from the current count. This method returns false if the count is already at zero or if the new count would be less than zero.
public TrySignal ( int signalCount ) : bool
signalCount int The amount to change the current count. This must be greater than zero.
리턴 bool

Wait() 공개 메소드

Synchronously waits for this event to be set. This method may block the calling thread.
public Wait ( ) : void
리턴 void

Wait() 공개 메소드

Synchronously waits for this event to be set. This method may block the calling thread.
public Wait ( CancellationToken cancellationToken ) : void
cancellationToken System.Threading.CancellationToken The cancellation token used to cancel the wait. If this token is already canceled, this method will first check whether the event is set.
리턴 void

WaitAsync() 공개 메소드

Asynchronously waits for this event to be set.
public WaitAsync ( ) : Task
리턴 Task