C# Class CyrusBuilt.MonoPi.Components.Sensors.SensorBase

Base class for sensor abstraction components.
Inheritance: ISensor
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Components.Sensors.SensorBase object.

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

HasProperty ( String key ) : System.Boolean

Determines whether this instance has property the specified key.

IsState ( SensorState state ) : System.Boolean

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

ToString ( ) : string

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Sensors.SensorBase.

Protected Methods

Method Description
Dispose ( System.Boolean disposing ) : void

Releaseses all resources used this object.

OnStateChanged ( SensorStateChangedEventArgs e ) : void

Raises the state changed event.

SensorBase ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Sensors.SensorBase class. This is the default constructor.

SensorBase ( IGpio pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Sensors.SensorBase class with the pin being used to read the sensor input.

Method Details

Dispose() public method

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

Dispose() protected method

Releaseses all resources used this object.
protected Dispose ( System.Boolean disposing ) : void
disposing System.Boolean /// Set true if disposing managed resources in addition to unmanaged. ///
return void

HasProperty() public method

Determines whether this instance has property the specified key.
public HasProperty ( String key ) : System.Boolean
key String /// The key name of the property to check for. ///
return System.Boolean

IsState() public method

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

OnStateChanged() protected method

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

SensorBase() protected method

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

SensorBase() protected method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Sensors.SensorBase class with the pin being used to read the sensor input.
/// cannot be null. ///
protected SensorBase ( IGpio pin ) : System
pin IGpio /// The pin being used to read the sensor input. ///
return System

ToString() public method

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Sensors.SensorBase.
public ToString ( ) : string
return string