C# Класс CyrusBuilt.MonoPi.Components.Switches.SwitchComponent

A component that is an abstraction of a standard switch. This is an implementation of CyrusBuilt.MonoPi.Components.Switches.SwitchBase.
Наследование: SwitchBase
Показать файл Открыть проект

Открытые методы

Метод Описание
Dispose ( ) : void

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

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

InterruptPoll ( ) : void

Interrupts the poll cycle.

Poll ( ) : void

Polls the input pin status.

SwitchComponent ( IGpio pin ) : System

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

ToString ( ) : String

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

Приватные методы

Метод Описание
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.SwitchComponent object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Switches.SwitchComponent. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Switches.SwitchComponent in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Switches.SwitchComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Switches.SwitchComponent was occupying.
public Dispose ( ) : void
Результат void

InterruptPoll() публичный Метод

Interrupts the poll cycle.
public InterruptPoll ( ) : void
Результат void

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

SwitchComponent() публичный Метод

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Switches.SwitchComponent class with the pin the switch is wired to.
public SwitchComponent ( IGpio pin ) : System
pin IGpio /// The input pin to check switch state on. ///
Результат System

ToString() публичный Метод

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Switches.SwitchComponent.
public ToString ( ) : String
Результат String