C# Класс WebApplications.Utilities.Threading.AsyncTimer

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
MinimumPeriod System.Duration

Открытые методы

Метод Описание
AsyncTimer ( [ callback, System.Duration period = null, System.Duration dueTime = null, System.Duration minimumGap = null, PauseToken pauseToken = default(PauseToken), Action errorHandler = null ) : System

Initializes a new instance of the AsyncTimer class.

AsyncTimer ( [ callback, int period = Timeout.Infinite, int dueTime, int minimumGap, PauseToken pauseToken = default(PauseToken), Action errorHandler = null ) : System

Initializes a new instance of the AsyncTimer class.

AsyncTimer ( [ callback, System.Duration period = null, System.Duration dueTime = null, System.Duration minimumGap = null, PauseToken pauseToken = default(PauseToken), Action errorHandler = null ) : System

Initializes a new instance of the AsyncTimer class.

AsyncTimer ( [ callback, int period = Timeout.Infinite, int dueTime, int minimumGap, PauseToken pauseToken = default(PauseToken), Action errorHandler = null ) : System

Initializes a new instance of the AsyncTimer class.

Change ( System.Duration period = null, System.Duration dueTime = null, System.Duration minimumGap = null ) : void

Changes the specified due time and period.

Change ( int period = null, int dueTime = null, int minimumGap = null ) : void

Changes the specified due time and period.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Приватные методы

Метод Описание
ExecuteAsync ( CancellationToken cancellationToken = default(CancellationToken) ) : Task
TimerTask ( CancellationToken cancellationToken ) : Task

The timer task executes the callback asynchronously after set delays.

Описание методов

AsyncTimer() публичный Метод

Initializes a new instance of the AsyncTimer class.
public AsyncTimer ( [ callback, System.Duration period = null, System.Duration dueTime = null, System.Duration minimumGap = null, PauseToken pauseToken = default(PauseToken), Action errorHandler = null ) : System
callback [ The asynchronous method to be executed.
period System.Duration The minimum gap between the start of the task invocation and the start of the previous task invocation (defautls to which is equivalent to ).
dueTime System.Duration The due time between the last time the timeouts were changed and the start of the task invocation (defautls to which is equivalent to ).
minimumGap System.Duration The minimum gap between the start of the task invocation and the end of the previous task invocation (defautls to which is equivalent to ).
pauseToken PauseToken The pause token for pasuing the timer.
errorHandler Action The optional error handler.
Результат System

AsyncTimer() публичный Метод

Initializes a new instance of the AsyncTimer class.
public AsyncTimer ( [ callback, int period = Timeout.Infinite, int dueTime, int minimumGap, PauseToken pauseToken = default(PauseToken), Action errorHandler = null ) : System
callback [ The callback.
period int The minimum gap (in milliseconds) between the start of the task invocation and the start of the previous task invocation (defaults to ).
dueTime int The due time (in milliseconds) between the last time the timeouts were changed and the start of the task invocation (defaults to 0ms).
minimumGap int The minimum gap (in milliseconds) between the start of the task invocation and the end of the previous task invocation (defaults to 0ms).
pauseToken PauseToken The pause token for pasuing the timer.
errorHandler Action The optional error handler.
Результат System

AsyncTimer() публичный Метод

Initializes a new instance of the AsyncTimer class.
public AsyncTimer ( [ callback, System.Duration period = null, System.Duration dueTime = null, System.Duration minimumGap = null, PauseToken pauseToken = default(PauseToken), Action errorHandler = null ) : System
callback [ The asynchronous method to be executed.
period System.Duration The minimum gap between the start of the task invocation and the start of the previous task invocation (defautls to which is equivalent to ).
dueTime System.Duration The due time between the last time the timeouts were changed and the start of the task invocation (defautls to which is equivalent to ).
minimumGap System.Duration The minimum gap between the start of the task invocation and the end of the previous task invocation (defautls to which is equivalent to ).
pauseToken PauseToken The pause token for pasuing the timer.
errorHandler Action The optional error handler.
Результат System

AsyncTimer() публичный Метод

Initializes a new instance of the AsyncTimer class.
public AsyncTimer ( [ callback, int period = Timeout.Infinite, int dueTime, int minimumGap, PauseToken pauseToken = default(PauseToken), Action errorHandler = null ) : System
callback [ The callback.
period int The minimum gap (in milliseconds) between the start of the task invocation and the start of the previous task invocation (defaults to ).
dueTime int The due time (in milliseconds) between the last time the timeouts were changed and the start of the task invocation (defaults to 0ms).
minimumGap int The minimum gap (in milliseconds) between the start of the task invocation and the end of the previous task invocation (defaults to 0ms).
pauseToken PauseToken The pause token for pasuing the timer.
errorHandler Action The optional error handler.
Результат System

Change() публичный Метод

Changes the specified due time and period.
public Change ( System.Duration period = null, System.Duration dueTime = null, System.Duration minimumGap = null ) : void
period System.Duration The optional minimum gap between the start of the task invocation and the start of the previous task invocation; use to leave the value unchanged.
dueTime System.Duration The optional due time between the last time the timeouts were changed and the start of the task invocation; use to leave the value unchanged.
minimumGap System.Duration The optional minimum gap between the start of the task invocation and the end of the previous task invocation; use to leave the value unchanged.
Результат void

Change() публичный Метод

Changes the specified due time and period.
public Change ( int period = null, int dueTime = null, int minimumGap = null ) : void
period int The optional minimum gap (in milliseconds) between the start of the task invocation and the start of the previous task invocation; use to leave the value unchanged.
dueTime int The optional due time (in milliseconds) between the last time the timeouts were changed and the start of the task invocation; use to leave the value unchanged.
minimumGap int The optional minimum gap (in milliseconds) between the start of the task invocation and the end of the previous task invocation; use to leave the value unchanged.
Результат void

Dispose() публичный Метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Описание свойств

MinimumPeriod публичное статическое свойство

The minimum period, prevents the timer thrashing too quickly.
public static Duration,System MinimumPeriod
Результат System.Duration