Class DebounceDispatcher

Provides Debounce() and Throttle() methods. Use these methods to ensure that events aren't handled too frequently.

Throttle() ensures that events are throttled by the interval specified. Only the last event in the interval sequence of events fires.

Debounce() fires an event only after the specified interval has passed in which no other pending event has fired. Only the last event in the sequence is fired.

More info: https://weblog.west-wind.com/posts/2017/Jul/02/Debouncing-and-Throttling-Dispatcher-Events

System.Object
  MarkdownMonster.Windows.DebounceDispatcher
public class DebounceDispatcher : object

Class Members

MemberDescription

Constructor

Debounce

Debounce an event by resetting the event timeout every time the event is fired. The behavior is that the Action passed is fired only after events stop firing for the given timeout period.

public void Debounce(int interval,     Action action,     object param,     DispatcherPriority priority,     Dispatcher disp)

Throttle

This method throttles events by allowing only 1 event to fire for the given timeout period. Only the last event fired is handled - all others are ignored. Throttle will fire events every timeout ms even if additional events are pending.

public void Throttle(int interval,     Action action,     object param,     DispatcherPriority priority,     Dispatcher disp)

Requirements

Namespace: MarkdownMonster.Windows
Assembly: markdownmonster.exe

© West Wind Technologies, 2016-2024 • Updated: 11/23/21
Comment or report problem with topic