C# Класс SimpleHelpers.ConsoleUtils

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
cultureBR System.Globalization.CultureInfo
cultureUS System.Globalization.CultureInfo

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

Метод Описание
CloseApplication ( int exitCode, bool exitApplication ) : void

Execute some housekeeping and closes the application.

DisplayHeader ( ) : void
DisplaySeparator ( ) : void
GetUserInput ( string message ) : string
GetUserInputAsBool ( string message ) : bool
GetUserInputAsDouble ( string message ) : double
GetUserInputAsInt ( string message ) : int
GetUserInputAsList ( string message ) : IEnumerable
GetUserInputKey ( string message = null ) : char
Initialize ( string args, bool thrownOnError, InitializationOptions options = null ) : FlexibleOptions

Parses command line and app.config arguments and initilialize log.

ReadFileAllLines ( string filename ) : string[]
ReadFileAllText ( string filename ) : string
WaitForAnyKey ( ) : void
WaitForAnyKey ( string message ) : void

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

Метод Описание
CheckCommandLineParams ( string args, bool thrownOnError ) : FlexibleOptions

Checks the command line params. arguments format: key=value or --key value

DefaultProgramInitialization ( ) : void
GetLogger ( ) : Logger
GetNLogTargetName ( NLog target ) : IEnumerable
InitializeLog ( InitializationOptions options ) : void

Initializes log with initialization options.

InitializeLog ( string logFileName = null, string logLevel = null, InitializationOptions initOptions = null, FlexibleOptions appOptions = null ) : void

Log initialization.

LoadExtenalConfigurationFile ( string filePath, bool thrownOnError ) : FlexibleOptions
LoadFileSystemConfigurationFile ( string filePath, bool thrownOnError ) : FlexibleOptions
LoadWebConfigurationFile ( string filePath, bool thrownOnError ) : FlexibleOptions
ParseCommandLineArguments ( string args ) : FlexibleOptions
parseFile ( string content ) : FlexibleOptions
show_help ( string message, bool isError = false ) : void

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

CloseApplication() публичный статический Метод

Execute some housekeeping and closes the application.
public static CloseApplication ( int exitCode, bool exitApplication ) : void
exitCode int The exit code.
exitApplication bool
Результат void

DisplayHeader() публичный статический Метод

public static DisplayHeader ( ) : void
Результат void

DisplaySeparator() публичный статический Метод

public static DisplaySeparator ( ) : void
Результат void

GetUserInput() публичный статический Метод

public static GetUserInput ( string message ) : string
message string
Результат string

GetUserInputAsBool() публичный статический Метод

public static GetUserInputAsBool ( string message ) : bool
message string
Результат bool

GetUserInputAsDouble() публичный статический Метод

public static GetUserInputAsDouble ( string message ) : double
message string
Результат double

GetUserInputAsInt() публичный статический Метод

public static GetUserInputAsInt ( string message ) : int
message string
Результат int

GetUserInputAsList() публичный статический Метод

public static GetUserInputAsList ( string message ) : IEnumerable
message string
Результат IEnumerable

GetUserInputKey() публичный статический Метод

public static GetUserInputKey ( string message = null ) : char
message string
Результат char

Initialize() публичный статический Метод

Parses command line and app.config arguments and initilialize log.
public static Initialize ( string args, bool thrownOnError, InitializationOptions options = null ) : FlexibleOptions
args string Program arguments
thrownOnError bool The thrown exception on internal initialization error.
options InitializationOptions The additional options.
Результат FlexibleOptions

ReadFileAllLines() публичный статический Метод

public static ReadFileAllLines ( string filename ) : string[]
filename string
Результат string[]

ReadFileAllText() публичный статический Метод

public static ReadFileAllText ( string filename ) : string
filename string
Результат string

WaitForAnyKey() публичный статический Метод

public static WaitForAnyKey ( ) : void
Результат void

WaitForAnyKey() публичный статический Метод

public static WaitForAnyKey ( string message ) : void
message string
Результат void

Описание свойств

cultureBR публичное статическое свойство

public static CultureInfo,System.Globalization cultureBR
Результат System.Globalization.CultureInfo

cultureUS публичное статическое свойство

public static CultureInfo,System.Globalization cultureUS
Результат System.Globalization.CultureInfo