C# Class GSF.Threading.ActionExtensions

Defines extension methods for actions.
Datei anzeigen Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
DelayAndExecute ( this action, int delay ) : ICancellationToken

Execute an action on the thread pool after a specified number of milliseconds.

DelayAndExecute ( this action, WaitHandle waitObj, int delay ) : void

Execute an action on the thread pool after a specified number of milliseconds.

TryExecute ( this action, Action exceptionHandler ) : bool

Attempts to execute an action and processes exceptions using the given exception handler.

Method Details

DelayAndExecute() public static method

Execute an action on the thread pool after a specified number of milliseconds.
public static DelayAndExecute ( this action, int delay ) : ICancellationToken
action this The action to be executed.
delay int The amount of time to wait before execution, in milliseconds.
return ICancellationToken

DelayAndExecute() public static method

Execute an action on the thread pool after a specified number of milliseconds.
public static DelayAndExecute ( this action, WaitHandle waitObj, int delay ) : void
action this The action to be executed.
waitObj System.Threading.WaitHandle The wait handle to be used to cancel execution.
delay int The amount of time to wait before execution, in milliseconds.
return void

TryExecute() public static method

Attempts to execute an action and processes exceptions using the given exception handler.
or is null
public static TryExecute ( this action, Action exceptionHandler ) : bool
action this The action to be executed.
exceptionHandler Action The handler to be called in the event of an error.
return bool