C# 클래스 CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent

A component that is an abstraction of a momentary switch. This is an implementation of CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchBase.
상속: MomentarySwitchBase
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi

공개 메소드들

메소드 설명
Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent object.

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

InterruptPoll ( ) : void

Interrupts the poll cycle.

MomentarySwitchComponent ( IGpio pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent class with the pin the switch is wired to.

Poll ( ) : void

Polls the input pin status.

ToString ( ) : String

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent.

비공개 메소드들

메소드 설명
BackgroundExecutePoll ( ) : void

Executes the poll cycle on a background thread.

ExecutePoll ( ) : void

Executes the poll cycle. Does not return until CyrusBuilt.MonoPi.Components.Switches.SwitchComponent.InterruptPoll is called.

OnStateChanged ( Object sender, PinStateChangeEventArgs e ) : void

Raises the state changed event.

메소드 상세

Dispose() 공개 메소드

Releases all resource used by the CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent was occupying.
public Dispose ( ) : void
리턴 void

InterruptPoll() 공개 메소드

Interrupts the poll cycle.
public InterruptPoll ( ) : void
리턴 void

MomentarySwitchComponent() 공개 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent class with the pin the switch is wired to.
public MomentarySwitchComponent ( IGpio pin ) : System
pin IGpio /// The input pin to check switch state on. ///
리턴 System

Poll() 공개 메소드

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

ToString() 공개 메소드

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Switches.MomentarySwitchComponent.
public ToString ( ) : String
리턴 String