C# Class CyrusBuilt.MonoPi.Components.Lights.LightComponent

A component that is an abstraction of a light.
Inheritance: LightBase
显示文件 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Components.Lights.LightComponent object.

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

LightComponent ( IGpio pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Lights.LightComponent class with the pin controlling the light.

Off ( ) : void

Switches the light off.

On ( ) : void

Switches the light on.

Method Details

Dispose() public method

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

LightComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Lights.LightComponent class with the pin controlling the light.
/// The pin cannot be null. ///
public LightComponent ( IGpio pin ) : System
pin IGpio /// The output pin the light is wired to. ///
return System

Off() public method

Switches the light off.
/// The pin is configured for input instead of output. ///
public Off ( ) : void
return void

On() public method

Switches the light on.
/// The pin is configured for input instead of output. ///
public On ( ) : void
return void