C# Класс Open.Core.Common.DelayedAction

Invokes an action after a delay times out (cancelling any previous actions that may be pending).
This can be used to invoke something after a series of rapid events have fired, like key-strokes size changed.
Наследование: DisposableBase
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
DelayedAction ( double delaySeconds, System.Action action ) : System
Invoke ( double delay, System.Action action ) : DelayedAction

Invokes the given action after the specified delay.

Returns the 'DelayedAction' used to invoke the method (can be used to cancel the delayed invoke operation).

Start ( ) : void

Starts the delay timer. Subsequent calls to this method restart the timer.

Stop ( ) : void

Stops the timer.

Защищенные методы

Метод Описание
OnDisposed ( ) : void

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

Метод Описание
CreateTimer ( ) : DispatcherTimer
InvokeAction ( ) : void
OnActionInvoked ( ) : void
OnStarted ( ) : void
OnStopped ( ) : void
OnTimerElapsed ( object sender, EventArgs e ) : void
SetDelay ( DispatcherTimer targetTimer ) : void

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

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

public DelayedAction ( double delaySeconds, System.Action action ) : System
delaySeconds double
action System.Action
Результат System

Invoke() публичный статический Метод

Invokes the given action after the specified delay.
Returns the 'DelayedAction' used to invoke the method (can be used to cancel the delayed invoke operation).
public static Invoke ( double delay, System.Action action ) : DelayedAction
delay double The delay (in seconds) before invoking the action.
action System.Action The action to invoke.
Результат DelayedAction

OnDisposed() защищенный Метод

protected OnDisposed ( ) : void
Результат void

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

Starts the delay timer. Subsequent calls to this method restart the timer.
public Start ( ) : void
Результат void

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

Stops the timer.
public Stop ( ) : void
Результат void