C# Class System.Waf.Foundation.ThrottledAction

This class supports throttling of multiple method calls to improve the responsiveness of an application. It delays a method call and skips all additional calls of this method during the delay. The call of the action is synchronized. It uses the current synchronization context that was active during creating this class.
This class is thread-safe.
ファイルを表示 Open project: jbe2277/waf Class Usage Examples

Public Methods

Method Description
Cancel ( ) : void

Cancel the execution of the action delegate that was requested.

InvokeAccumulated ( ) : void

Requests the execution of the action delegate.

ThrottledAction ( Action action ) : System.Threading

Initializes a new instance of the ThrottledAction class.

ThrottledAction ( Action action, ThrottledActionMode mode, TimeSpan delayTime ) : System.Threading

Initializes a new instance of the ThrottledAction class.

Private Methods

Method Description
TimerCallback ( object state ) : void

Method Details

Cancel() public method

Cancel the execution of the action delegate that was requested.
public Cancel ( ) : void
return void

InvokeAccumulated() public method

Requests the execution of the action delegate.
public InvokeAccumulated ( ) : void
return void

ThrottledAction() public method

Initializes a new instance of the ThrottledAction class.
The argument action must not be null.
public ThrottledAction ( Action action ) : System.Threading
action Action The action that should be throttled.
return System.Threading

ThrottledAction() public method

Initializes a new instance of the ThrottledAction class.
The argument action must not be null.
public ThrottledAction ( Action action, ThrottledActionMode mode, TimeSpan delayTime ) : System.Threading
action Action The action that should be throttled.
mode ThrottledActionMode Defines the throttling mode.
delayTime TimeSpan The delay time.
return System.Threading