Click or drag to resize

CallLimiterCall Method (Action, Double, ISynchronizeInvoke)

Calls the specified to call after intervalMS milliseconds, unless a call is already in progress, in which case the call is ignored. It doesn't matter if this method was called previously with a different toCall value.

Namespace:  SD.Tools.Algorithmia.GeneralDataStructures
Assembly:  SD.Tools.Algorithmia (in SD.Tools.Algorithmia.dll) Version: 1.3.3.0 (1.3.18.0209)
Syntax
public bool Call(
	Action toCall,
	double intervalMS,
	ISynchronizeInvoke synchronizingObject
)

Parameters

toCall
Type: SystemAction
The func to call.
intervalMS
Type: SystemDouble
The interval to wait, in ms, before toCall is called. If interval is below 100, it's clamped to 100.
synchronizingObject
Type: System.ComponentModelISynchronizeInvoke
The synchronizing object. If null, the call to the lambda specified to Call(Action, Double, ISynchronizeInvoke) might be done on a different thread, as the System timer used is using a threadpool in that case. If the call has to be the same thread as the UI, specify a UI object as synchronizingObject, e.g. a form object or control object on which this limiter is used.

Return Value

Type: Boolean
true if the call is accepted and will be performed in intervalMS ms. False if the call is ignored if a timer is already in progress.
See Also