Class ParameterExtensions
- Namespace
- TechnologySolutions.Rfid.AsciiProtocol.Parameters
- Assembly
- TechnologySolutions.Rfid.AsciiProtocol.Core.dll
Extension methods for parameters
public static class ParameterExtensions
- Inheritance
-
ParameterExtensions
- Inherited Members
Methods
Bool(ParameterCollection, string)
Returns the ParameterBool instance from parameters with the specified parameterIdentifier
public static ParameterBool Bool(this ParameterCollection parameters, string parameterIdentifier)
Parameters
parameters
ParameterCollectionThe collection to get the parameter from
parameterIdentifier
stringThe identifier for the parameter
Returns
- ParameterBool
The ParameterBool with the specified parameter identifier
Enum<TEnum>(ParameterCollection, string)
Returns the ParameterEnum<TEnum> instance from parameters with the specified parameterIdentifier
public static ParameterEnum<TEnum> Enum<TEnum>(this ParameterCollection parameters, string parameterIdentifier) where TEnum : struct
Parameters
parameters
ParameterCollectionThe collection to get the parameter from
parameterIdentifier
stringThe identifier for the parameter
Returns
- ParameterEnum<TEnum>
The ParameterEnum>TEnum> with the specified parameter identifier
Type Parameters
TEnum
Int(ParameterCollection, string)
Returns the ParameterInt instance from parameters with the specified parameterIdentifier
public static ParameterInt Int(this ParameterCollection parameters, string parameterIdentifier)
Parameters
parameters
ParameterCollectionThe collection to get the parameter from
parameterIdentifier
stringThe identifier for the parameter
Returns
- ParameterInt
The ParameterInt with the specified parameter identifier
Parse(ParameterCollection, string)
Parses a PR: value for parameters and updates the command with the values parsed
public static IEnumerable<string> Parse(this ParameterCollection parameters, string parameterLine)
Parameters
parameters
ParameterCollectionThe parameters collection used to validate the parameterLine
parameterLine
stringThe line containing parameters to parse
Returns
- IEnumerable<string>
The individual parameters from the line
Text(ParameterCollection, string)
Returns the ParameterText instance from parameters with the specified parameterIdentifier
public static ParameterText Text(this ParameterCollection parameters, string parameterIdentifier)
Parameters
parameters
ParameterCollectionThe collection to get the parameter from
parameterIdentifier
stringThe identifier for the parameter
Returns
- ParameterText
The ParameterText with the specified parameter identifier
ValidateAndParse(ParameterCollection, string)
Parses a command line or PR: value and updates the commands parameter to match. Returns validation messages for any errors encountered
public static ICollection<string> ValidateAndParse(this ParameterCollection parameters, string parameterLine)
Parameters
parameters
ParameterCollectionThe parameters collection used to validate the parameterLine
parameterLine
stringThe parameters to parse
Returns
- ICollection<string>
Any validation messages arising from parsing the parameter line
ValidateAndParse(ParameterCollection, string, out IEnumerable<string>)
Parses a command line or PR: value and updates the commands parameter to match. Returns validation messages for any errors encountered
public static ICollection<string> ValidateAndParse(this ParameterCollection parameters, string parameterLine, out IEnumerable<string> parameterSet)
Parameters
parameters
ParameterCollectionThe parameters collection used to validate the parameterLine
parameterLine
stringThe parameters to parse
parameterSet
IEnumerable<string>output the parameter line split into individual parameters
Returns
- ICollection<string>
Any validation messages arising from parsing the parameter line