C# 클래스 PowerArgs.ActionDebouncer

A class that can be used to ensure an action only fires after a burst of triggers ends.
파일 보기 프로젝트 열기: adamabdelhamed/PowerArgs

공개 메소드들

메소드 설명
ActionDebouncer ( System.TimeSpan burstTimeWindow, System.Action callback ) : System

Creates the debouncer given a bust time window and an action callback.

Trigger ( ) : void

Triggers a burst. If this is the first trigger in a burst of events then a countdown of duration BurstTimeWindow begins. If this trigger occurs while the countdown is in the process of counting to zero then the countdown is reset. If the countdown ever hits zero then the callback fires and the burst is complete.

메소드 상세

ActionDebouncer() 공개 메소드

Creates the debouncer given a bust time window and an action callback.
public ActionDebouncer ( System.TimeSpan burstTimeWindow, System.Action callback ) : System
burstTimeWindow System.TimeSpan The time span that determines the time window. When a trigger fires, the debouncer will wait this amount of time before executing the callback. If a trigger fires before the time elapses, the timer is reset.
callback System.Action The action to execute when a trigger fires and the burst time window elapses.
리턴 System

Trigger() 공개 메소드

Triggers a burst. If this is the first trigger in a burst of events then a countdown of duration BurstTimeWindow begins. If this trigger occurs while the countdown is in the process of counting to zero then the countdown is reset. If the countdown ever hits zero then the callback fires and the burst is complete.
public Trigger ( ) : void
리턴 void