Class ButtonBase
Base implementation of Button logic. Hardware independent. Inherit for specific hardware handling.
public class ButtonBase
- Inheritance
-
ButtonBase
- Derived
Constructors
ButtonBase()
Initializes a new instance of the ButtonBase class.
public ButtonBase()
ButtonBase(TimeSpan, TimeSpan, TimeSpan)
Initializes a new instance of the ButtonBase class.
public ButtonBase(TimeSpan doublePress, TimeSpan holding, TimeSpan debounceTime = default)
Parameters
doublePress
TimeSpanMax ticks between button presses to count as doublepress.
holding
TimeSpanMin ms a button is pressed to count as holding.
debounceTime
TimeSpanThe amount of time during which the transitions are ignored, or zero.
Properties
IsDoublePressEnabled
Gets or sets a value indicating whether double press event is enabled or disabled on the button.
public bool IsDoublePressEnabled { get; set; }
Property Value
IsHoldingEnabled
Gets or sets a value indicating whether holding event is enabled or disabled on the button.
public bool IsHoldingEnabled { get; set; }
Property Value
IsPressed
Gets or sets a value indicating whether single press event is enabled or disabled on the button.
public bool IsPressed { get; set; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
Cleanup resources.
protected virtual void Dispose(bool disposing)
Parameters
disposing
boolShould dispose managed resources.
HandleButtonPressed()
Handler for pressing the button.
protected void HandleButtonPressed()
HandleButtonReleased()
Handler for releasing the button.
protected void HandleButtonReleased()
Events
ButtonDown
Delegate for button down event.
public event ButtonBase.ButtonPressedDelegate ButtonDown
Event Type
ButtonUp
Delegate for button up event.
public event ButtonBase.ButtonPressedDelegate ButtonUp
Event Type
DoublePress
Delegate for button double pressed event.
public event ButtonBase.ButtonPressedDelegate DoublePress
Event Type
Holding
Delegate for button holding event.
public event ButtonBase.ButtonHoldingDelegate Holding
Event Type
Press
Delegate for button pressed event.
public event ButtonBase.ButtonPressedDelegate Press