C# Класс Crisis.CommandLine.UsageInfo

Represents the properties of a CommandLineManagerAttribute (or rather the object to which its applied) that describe the command line syntax.
This class is the only way to programatically set usage descriptions, group names and similar, which is required if globalization of the usage description is desired. Users can not instantiate objects of this class, but they are retrieved by the CommandLineParser.UsageInfo property.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetErrorsAsString ( int width ) : string

Gets the list of errors as a formatted string.

GetGroup ( string id ) : OptionGroupInfo

Gets the option group with the specified id.

GetHeaderAsString ( int width ) : string

Gets a string consisting of the program name, version and copyright notice.

This string is suitable for printing as the first output of a console application.

GetOption ( string name ) : OptionInfo

Gets the option with the specified name.

GetOptionsAsString ( int width ) : string

Gets a formatted string describing the options and groups available.

GetOptionsAsString ( int nameColumnWidth, int descriptionColumnWidth ) : string

Gets a string describing all the options of this option manager. Usable for displaying as a help message to the user, provided that descriptions for all options and groups are provided.

ToString ( ) : string

Returns a that represents the current .

This is equivalent to calling ToString(78)

ToString ( int width ) : string

Converts this UsageInfo instance to a string.

ToString ( int width, bool includeErrors ) : string

Converts this UsageInfo instance to a string.

Приватные методы

Метод Описание
UsageInfo ( IOption>.SCG options, OptionStyles optionStyles, CommandLineParser parser ) : System

Initializes a new instance of the UsageInfo class.

Описание методов

GetErrorsAsString() публичный Метод

Gets the list of errors as a formatted string.
public GetErrorsAsString ( int width ) : string
width int The width of the field in which to format the error list.
Результат string

GetGroup() публичный Метод

Gets the option group with the specified id.
public GetGroup ( string id ) : OptionGroupInfo
id string The id of the option group to retrieve.
Результат OptionGroupInfo

GetHeaderAsString() публичный Метод

Gets a string consisting of the program name, version and copyright notice.
This string is suitable for printing as the first output of a console application.
public GetHeaderAsString ( int width ) : string
width int The total width in characters in which the string should be fitted
Результат string

GetOption() публичный Метод

Gets the option with the specified name.
public GetOption ( string name ) : OptionInfo
name string The name of the option to retrieve.
Результат OptionInfo

GetOptionsAsString() публичный Метод

Gets a formatted string describing the options and groups available.
The specified width was too small to generate the requested list.
public GetOptionsAsString ( int width ) : string
width int The maximum width of each line in the returned string.
Результат string

GetOptionsAsString() публичный Метод

Gets a string describing all the options of this option manager. Usable for displaying as a help message to the user, provided that descriptions for all options and groups are provided.
public GetOptionsAsString ( int nameColumnWidth, int descriptionColumnWidth ) : string
nameColumnWidth int The width in characters of the column holding the names of the options.
descriptionColumnWidth int The width in characters of the column holding the descriptions of the options.
Результат string

ToString() публичный Метод

Returns a that represents the current .
This is equivalent to calling ToString(78)
public ToString ( ) : string
Результат string

ToString() публичный Метод

Converts this UsageInfo instance to a string.
public ToString ( int width ) : string
width int The width of the field (in characters) in which to format the usage description.
Результат string

ToString() публичный Метод

Converts this UsageInfo instance to a string.
public ToString ( int width, bool includeErrors ) : string
width int The width of the field (in characters) in which to format the usage description.
includeErrors bool if set to true any errors that occured during parsing the command line will be included /// in the output.
Результат string