Class ParameterBool
- Namespace
- TechnologySolutions.Rfid.AsciiProtocol.Parameters
- Assembly
- TechnologySolutions.Rfid.AsciiProtocol.Core.dll
Represents a parameter which is either present or not and does not have an associated value. For example take no action '-n'
public class ParameterBool : ParameterBase<bool>, IParameterAndValue<bool>, IParameterValue<bool>, ICommandParameter, IParameterAction
- Inheritance
-
ParameterBool
- Implements
- Inherited Members
Constructors
ParameterBool(string)
Initializes a new instance of the ParameterBool class
public ParameterBool(string identifier)
Parameters
identifier
stringThe character(s) that identify the parameter on the command line
Methods
AppendToCommandLine(StringBuilder)
Appends the parameter to the command line
public override void AppendToCommandLine(StringBuilder line)
Parameters
line
StringBuilderThe builder for the command line
Remarks
bool parameter is only output if the value is true
ParseValue(string)
Attempt to parse the value from the command line and assign value to the parsed value
protected override void ParseValue(string value)
Parameters
value
stringThe value to parse
Remarks
The ParameterBool is a special case. If the parameter identifier is present on the command line the value is true. This requires the value being reset to false before attempting to parse the value
Exceptions
- ArgumentOutOfRangeException
If the value is outside the permitted range
- FormatException
If the parameter is not in the expected format