C# Class Open.Core.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 or window size changed.
Inheritance: IDisposable
Mostrar archivo Open project: philcockfield/Open.TestHarness.SL Class Usage Examples

Public Methods

Method Description
DelayedAction ( double delaySeconds, System.Action action ) : System

Constructor.

Dispose ( ) : void
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.

Private Methods

Method Description
FireInvoked ( ) : void
InvokeAction ( ) : void

Method Details

DelayedAction() public method

Constructor.
public DelayedAction ( double delaySeconds, System.Action action ) : System
delaySeconds double The time delay in delay (in seconds).
action System.Action The action that is invoked after the delay.
return System

Dispose() public method

public Dispose ( ) : void
return void

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

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