Class ParameterInt
- Namespace
- TechnologySolutions.Rfid.AsciiProtocol.Parameters
- Assembly
- TechnologySolutions.Rfid.AsciiProtocol.Core.dll
Defines a parameter that is an optional integer
public class ParameterInt : ParameterBase<int?>, IParameterAndValue<int?>, IParameterValue<int?>, ICommandParameter, IParameterAction
- Inheritance
-
ParameterInt
- Implements
- Inherited Members
Constructors
ParameterInt(string, int, int)
Initializes a new instance of the ParameterInt class for decimal values
public ParameterInt(string identifier, int minimum, int maximum)
Parameters
identifier
stringThe character(s) that identify the parameter on the command line
minimum
intThe maximum permitted value when not null
maximum
intThe minimum permitted value when not null
ParameterInt(string, int, int, string)
Initializes a new instance of the ParameterInt class
public ParameterInt(string identifier, int minimum, int maximum, string parseFormat)
Parameters
identifier
stringThe character(s) that identify the parameter on the command line
minimum
intThe maximum permitted value when not null
maximum
intThe minimum permitted value when not null
parseFormat
stringA format string to output the value to the command line. This also indicates whether the value should be parsed as hex ("X" or decimal "D")
ParameterInt(string, string)
Initializes a new instance of the ParameterInt class
public ParameterInt(string identifier, string parseFormat)
Parameters
identifier
stringThe character(s) that identify the parameter on the command line
parseFormat
stringA format string to output the value to the command line. This also indicates whether the value should be parsed as hex (e.g. "X2" or decimal "D")
Properties
Maximum
Gets the maximum permitted value
public int Maximum { get; }
Property Value
Minimum
Gets the minimum permitted value
public int Minimum { get; }
Property Value
Methods
CheckValue(int?)
Checks that value is within the accepted range if the value is not null
protected override int? CheckValue(int? value)
Parameters
value
int?The value to check
Returns
- int?
The checked 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