Click or drag to resize

CommandLineAccess class

Access to command line parameters
Implements IGetStringValue. Minimal functionality:
If the transferred key exists in the command line, this is returned unchanged, otherwise the Default Value. If the transferred key is numeric, an attempt is made to recognise it with to access it as an index in the command line parameters; If successful, the corresponding value is returned, otherwise the default value.
Inheritance hierarchy
SystemObject
  NetEti.ApplicationEnvironmentCommandLineAccess

Namespace: NetEti.ApplicationEnvironment
Assembly: NetEti.CommandLineAccess (in NetEti.CommandLineAccess.dll) Version: 1.0.0+3107384b301fc859aaac3a434ff023e72488deba
Syntax
public class CommandLineAccess : IGetStringValue

The CommandLineAccess Type exposes the following members.

Constructors
 NameDescription of the
Public MethodCommandLineAccess Constructor - sets the internal reader
Back to the top
Properties
 NameDescription of the
Public PropertyCommandLine Returns the command line as a string.
Public PropertyDescription Returns a descriptive name of this StringValueGetter, e.g. name plus source path if applicable.
Back to the top
Methods
 NameDescription of the
Public MethodGetStringValue Returns exactly one value for a key. If there is no value for the key, defaultValue is returned.
Public MethodGetStringValues Returns a string array for a key. If there is no value for the key, defaultValue is returned. Returns only a single value packed as an array, may have to be be extended.
Back to the top
Remarks
File: CommandLineAccess.cs
Author: Erik Nagel, NetEti

13/03/2012 Erik Nagel: created
04.06.2014 Erik Nagel: Resolve named parameters (/name=xyz or -name=xyz)
10.04.2020 Erik Nagel: For resolution by numeric key (position number of the argument) Parameters preceded by '/' or '-' are excluded.
See also