C# Class 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.
Inheritance: DisposableBase
Mostrar archivo Open project: philcockfield/Open.TestHarness.SL Class Usage Examples

Public Methods

Method Description
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.

Protected Methods

Method Description
OnDisposed ( ) : void

Private Methods

Method Description
CreateTimer ( ) : DispatcherTimer
InvokeAction ( ) : void
OnActionInvoked ( ) : void
OnStarted ( ) : void
OnStopped ( ) : void
OnTimerElapsed ( object sender, EventArgs e ) : void
SetDelay ( DispatcherTimer targetTimer ) : void

Method Details

DelayedAction() public method

public DelayedAction ( double delaySeconds, System.Action action ) : System
delaySeconds double
action System.Action
return System

Invoke() public static method

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.
return DelayedAction

OnDisposed() protected method

protected OnDisposed ( ) : void
return void

Start() public method

Starts the delay timer. Subsequent calls to this method restart the timer.
public Start ( ) : void
return void

Stop() public method

Stops the timer.
public Stop ( ) : void
return void