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

A component that is an abstraction of a button. This is an implementation of CyrusBuilt.MonoPi.Components.Button.ButtonBase.
Inheritance: ButtonBase
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
ButtonComponent ( IGpio pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Button.ButtonComponent class with the pin the button is wired to.

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.ButtonComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Button.ButtonComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Button.ButtonComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Button.ButtonComponent was occupying.

InterruptPoll ( ) : void

Interrupts the poll cycle.

Poll ( ) : void

Polls the input pin status.

ToString ( ) : String

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Button.ButtonComponent.

Private Methods

Method Description
BackgroundExecutePoll ( ) : void

Executes the poll cycle on a background thread.

ExecutePoll ( ) : void

Executes the poll cycle. Does not return until CyrusBuilt.MonoPi.Components.Button.ButtonComponent.InterruptPoll is called.

OnPinStateChanged ( Object sender, PinStateChangeEventArgs e ) : void

Raises the pin state changed event.

Method Details

ButtonComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Button.ButtonComponent class with the pin the button is wired to.
public ButtonComponent ( IGpio pin ) : System
pin IGpio /// The input pin the button is wired to. ///
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.ButtonComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Button.ButtonComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Button.ButtonComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Button.ButtonComponent was occupying.
public Dispose ( ) : void
return void

InterruptPoll() public method

Interrupts the poll cycle.
public InterruptPoll ( ) : void
return void

Poll() public method

Polls the input pin status.
/// This instance has been disposed. /// /// The specified pin is configured for output instead of input. ///
public Poll ( ) : void
return void

ToString() public method

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Button.ButtonComponent.
public ToString ( ) : String
return String