C# Class CyrusBuilt.MonoPi.Components.Button.ButtonBase

Base class for button device abstraction components.
Inheritance: ComponentBase, IButton
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Button.ButtonBase. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Button.ButtonBase in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Button.ButtonBase so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Button.ButtonBase was occupying.

IsState ( ButtonState state ) : System.Boolean

Determines whether this button's state is the specified state.

Protected Methods

Method Description
ButtonBase ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Button.ButtonBase class. This is the default constructor.

OnHold ( ButtonEventArgs e ) : void

Raises the ButtonBase.Hold event.

OnPressed ( ButtonEventArgs e ) : void

Raises the ButtonBase.Pressed event.

OnReleased ( ButtonEventArgs e ) : void

Raises the ButtonBase.Released event.

OnStateChanged ( ButtonEventArgs e ) : void

Raises the state changed event.

Private Methods

Method Description
HoldTimer_Elapsed ( Object sender, System.Timers.ElapsedEventArgs e ) : void

Handles the button hold timer elapsed event.

Method Details

ButtonBase() protected method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Button.ButtonBase class. This is the default constructor.
protected ButtonBase ( ) : System
return System

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Button.ButtonBase. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Button.ButtonBase in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Button.ButtonBase so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Button.ButtonBase was occupying.
public Dispose ( ) : void
return void

IsState() public method

Determines whether this button's state is the specified state.
public IsState ( ButtonState state ) : System.Boolean
state ButtonState /// The state to check. ///
return System.Boolean

OnHold() protected method

Raises the ButtonBase.Hold event.
protected OnHold ( ButtonEventArgs e ) : void
e ButtonEventArgs /// The event arguments. ///
return void

OnPressed() protected method

Raises the ButtonBase.Pressed event.
protected OnPressed ( ButtonEventArgs e ) : void
e ButtonEventArgs /// The event arguments. ///
return void

OnReleased() protected method

Raises the ButtonBase.Released event.
protected OnReleased ( ButtonEventArgs e ) : void
e ButtonEventArgs /// The event arguments. ///
return void

OnStateChanged() protected method

Raises the state changed event.
protected OnStateChanged ( ButtonEventArgs e ) : void
e ButtonEventArgs /// The button event arguments. ///
return void