Click or drag to resize

ZWOptions Class

A class that manages program options read from XML files or the command line.
Inheritance Hierarchy
SystemObject
  OpenZWaveZWOptions

Namespace:  OpenZWave
Assembly:  OpenZWave (in OpenZWave.dll) Version: 255.255.255.255
Syntax
public sealed class ZWOptions

The ZWOptions type exposes the following members.

Properties
  NameDescription
Public propertyAreLocked
Test whether the options have been locked.
Public propertyStatic memberInstance
Gets the singleton instance of the options
Top
Methods
  NameDescription
Public methodAddOptionBool
Add a boolean option to the program.
Public methodAddOptionInt
Add an integer option to the program.
Public methodAddOptionString
Add a string option to the program.
Public methodDestroy
Deletes the Options and cleans up any associated objects. The application is responsible for destroying the Options object, but this must not be done until after the Manager object has been destroyed.
Public methodGetOptionAsBool
Public methodGetOptionAsInt
Public methodGetOptionAsString
Public methodGetOptionType
Get the type of value stored in an option.
Public methodInitialize
Creates an object to manage the program options using the default data paths.
Public methodInitialize(String, String, String)
Creates an object to manage the program options.
Public methodLock
Locks the options.
Top
Remarks
The OpenZWave Manager class requires a complete and locked Options object when created. The Options are therefore one of the first things that any OpenZWave application must deal with. Options are first read from an XML file called options.xml located in the User data folder (the path to which is supplied to the Options::Create method). This is the same folder that will be used by the Manager to save the state of each controller in the Z-Wave network, to avoid querying them for their entire state every time the application starts up. The second source of program options is a string, which will normally be the command line used to launch the application. In this way, common options can be specified in the XML, but over-ridden if necessary by the command line.
The Options process is as follows:
1) Create an Options object, providing paths to the OpenZWave config folder, the User data folder and any command line string containing program options.
2) Call Options::AddOptionBool, Options::AddOptionInt or Options::AddOptionString to add any application-specific configurable options The OpenZWave options will already have been added during construction of the Options object.
3) Call Options::Lock. This will cause the option values to be read from the options.xml file and the command line string, and will lock the options
so that no more calls aside from GetOptionAs may be made. 4) Create the OpenZWave Manager object.
See Also