Свойство | Type | Description | |
---|---|---|---|
Definition | |||
Interrupted | bool | ||
IsRedirected | bool |
Свойство | Type | Description | |
---|---|---|---|
_log | log4net.ILog |
Méthode | Description | |
---|---|---|
AddFlagArgument ( string key, string desc ) : FlagArgument |
Convenience method for defining a new flag argument.
|
|
AddFlagArgument ( string key, string desc, |
Convenience method for defining a new flag argument.
|
|
AddKeywordArgument ( string key, string desc ) : KeywordArgument |
Convenience method for defining a new keyword argument.
|
|
AddKeywordArgument ( string key, string desc, |
Convenience method for defining a new keyword argument.
|
|
AddPositionalArgument ( string key, string desc ) : |
Convenience method for defining a new positional argument.
|
|
AddPositionalArgument ( string key, string desc, |
Convenience method for defining a new positional argument.
|
|
ClassifyArguments ( IEnumerable |
Classifies the supplied list of arguments, returning a count of the number of positional arguments found.
|
|
ClearArguments ( ) : void |
Clear existing arguments from the definition.
|
|
ClearLine ( ) : void |
Clears the last text written to the console using Write. Note that this may be more than a single line of text, if the window width is less than the length of the string written.
|
|
DisplayTitle ( |
Displays the application title, version etc.
|
|
DisplayUsage ( |
Displays a usgae message, based on the allowed arguments and purpose represented by this class.
|
|
Parse ( IEnumerable |
Parses the supplied set of arg strings using the list of Argument definitions maintained by this command-line UI instance.
|
|
ReadLine ( string prompt ) : string |
For completeness - read a line of input from the console.
|
|
ReadPassword ( string prompt ) : string |
Reads a password from the command-line, echoing * for each keypress.
|
|
RegisterCtrlHandler ( ) : Win32.Handler |
This method registers this class as a handler for Ctrl-C etc events in the console. It returns a handle to the handler, which should be referenced via the following at the end of the program Main method: GC.KeepAlive(hr);
|
|
UI ( string help ) : System |
Constructor; requires a purpose for the program whose args we are parsing.
|
|
WithColor ( ConsoleColor color, System.Action op ) : void |
Performs the specified operation +op+ with the console color temporarily changed to +color+. On completion of the operation, the color is reset to the original color.
|
|
Write ( string line ) : void |
Writes a partial line of text to the console, without moving to the next line.
|
|
WriteLine ( ) : void |
Writes a blank line to the console.
|
|
WriteLine ( string text ) : void |
Writes a line of text to the console, ensuring lines the same width as the console don't output an unnecessary new-line.
|
Méthode | Description | |
---|---|---|
OutputArg ( |
Méthode | Description | |
---|---|---|
CtrlHandler ( EInterruptTypes ctrlType ) : bool |
Handler to receive control events, such as Ctrl-C and logoff and shutdown events. As a minimum, this logs the event, so that a record of why the process exited is maintained.
|
public AddFlagArgument ( string key, string desc ) : FlagArgument | ||
key | string | |
desc | string | |
Résultat | FlagArgument |
public AddFlagArgument ( string key, string desc, |
||
key | string | |
desc | string | |
onParse | ||
Résultat | FlagArgument |
public AddKeywordArgument ( string key, string desc ) : KeywordArgument | ||
key | string | |
desc | string | |
Résultat | KeywordArgument |
public AddKeywordArgument ( string key, string desc, |
||
key | string | |
desc | string | |
onParse | ||
Résultat | KeywordArgument |
public AddPositionalArgument ( string key, string desc ) : |
||
key | string | |
desc | string | |
Résultat |
public AddPositionalArgument ( string key, string desc, |
||
key | string | |
desc | string | |
onParse | ||
Résultat |
public ClassifyArguments ( IEnumerable |
||
args | IEnumerable |
|
Résultat | int |
public DisplayTitle ( |
||
console | ||
Résultat | void |
public DisplayUsage ( |
||
console | ||
args | object>.Dictionary | |
Résultat | void |
protected OutputArg ( |
||
arg | ||
console | ||
Résultat | void |
public Parse ( IEnumerable |
||
args | IEnumerable |
|
Résultat | object>.Dictionary |
public ReadPassword ( string prompt ) : string | ||
prompt | string | |
Résultat | string |
public static RegisterCtrlHandler ( ) : Win32.Handler | ||
Résultat | Win32.Handler |
public WithColor ( ConsoleColor color, System.Action op ) : void | ||
color | ConsoleColor | |
op | System.Action | |
Résultat | void |