Class ParameterText
- Namespace
- TechnologySolutions.Rfid.AsciiProtocol.Parameters
- Assembly
- TechnologySolutions.Rfid.AsciiProtocol.Core.dll
Represents a command line parameter that has a text value
public class ParameterText : ParameterBase<string>, IParameterAndValue<string>, IParameterValue<string>, ICommandParameter, IParameterAction
- Inheritance
-
ParameterText
- Implements
- Derived
- Inherited Members
Constructors
ParameterText(string, int, int)
Initializes a new instance of the ParameterText class
public ParameterText(string identifier, int minimumLength, int maximumLength)
Parameters
identifier
stringThe character(s) that identify the parameter on the command line
minimumLength
intThe minimum length of the string
maximumLength
intThe maximum length of the string
ParameterText(string, int, int, bool)
Initializes a new instance of the ParameterText class
public ParameterText(string identifier, int minimumLength, int maximumLength, bool quoted)
Parameters
identifier
stringThe character(s) that identify the parameter on the command line
minimumLength
intThe minimum length of the string
maximumLength
intThe maximum length of the string
quoted
boolTrue if the string is output surrounded with double quotes on the command line
Properties
IsQuoted
Gets or sets a value indicating whether the value output to the command line is surrounded in double quotes
public bool IsQuoted { get; set; }
Property Value
MaximumLength
Gets or sets the maximum length of the text in characters
public int MaximumLength { get; set; }
Property Value
MinimumLength
Gets or sets the minimum length of the text in characters
public int MinimumLength { get; set; }
Property Value
Methods
CheckValue(string)
Checks the text is within the length constraints as the Value property is assigned
protected override string CheckValue(string value)
Parameters
value
stringThe value to test
Returns
- string
The value to assign to the value
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
Exceptions
- ArgumentOutOfRangeException
If the value is outside the permitted range
- FormatException
If the parameter is not in the expected format