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.
Afficher le fichier Open project: jbe2277/waf Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
TimerCallback ( object state ) : void

Method Details

Cancel() public méthode

Cancel the execution of the action delegate that was requested.
public Cancel ( ) : void
Résultat void

InvokeAccumulated() public méthode

Requests the execution of the action delegate.
public InvokeAccumulated ( ) : void
Résultat void

ThrottledAction() public méthode

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.
Résultat System.Threading

ThrottledAction() public méthode

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.
Résultat System.Threading