Click or drag to resize

Throttle Class

Implements a simple timed throttle.

Calling Tick multiple times will restart the timer; there will be one single call to the action when the delay time has elapsed after the last tick.

Inheritance Hierarchy
SystemObject
  TomsToolbox.DesktopThrottle

Namespace:  TomsToolbox.Desktop
Assembly:  TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 1.0.64.0 (1.0.64.0)
Syntax
public class Throttle

The Throttle type exposes the following members.

Constructors
  NameDescription
Public methodThrottle(Action)
Initializes a new instance of the Throttle class with a default timeout of 100ms.
Public methodThrottle(TimeSpan, Action)
Initializes a new instance of the Throttle class.
Top
Methods
  NameDescription
Public methodTick
Ticks this instance to trigger the throttle.
Top
Extension Methods
Contracts
Invariants
_target != null
_timer != null
Learn more about contracts
See Also