C# Class FdoToolbox.Core.AppFramework.ConsoleApplication

Base application object for console applications
Inheritance: IDisposable
Show file Open project: jumpinjackie/fdotoolbox

Protected Properties

Property Type Description
_Command IConsoleCommand

Public Methods

Method Description
Ask ( string question ) : bool

Asks the specified question.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ParseArguments ( string args ) : void

Parse application-specific arguments.

Run ( string args ) : void

Run the application

ShowUsage ( ) : void

Display usage information for this application

Protected Methods

Method Description
CheckFile ( string fileName ) : string

Verifies the file name exists.

Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

GetArgument ( string prefix, string args ) : string

Gets an argument value with the given prefix. Arguments follow the convention [prefix]:[value]

IsSwitchDefined ( string strSwitch, string args ) : bool

Checks if a given parameter switch was defined

OnCancelKeyPress ( object sender, ConsoleCancelEventArgs e ) : void
ThrowIfEmpty ( string value, string parameter ) : void

Throws an ArgumentException if the given parameter value is empty

Method Details

Ask() public method

Asks the specified question.
public Ask ( string question ) : bool
question string The question.
return bool

CheckFile() protected method

Verifies the file name exists.
protected CheckFile ( string fileName ) : string
fileName string
return string

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

GetArgument() protected static method

Gets an argument value with the given prefix. Arguments follow the convention [prefix]:[value]
protected static GetArgument ( string prefix, string args ) : string
prefix string
args string
return string

IsSwitchDefined() protected static method

Checks if a given parameter switch was defined
protected static IsSwitchDefined ( string strSwitch, string args ) : bool
strSwitch string
args string
return bool

OnCancelKeyPress() protected method

protected OnCancelKeyPress ( object sender, ConsoleCancelEventArgs e ) : void
sender object
e System.ConsoleCancelEventArgs
return void

ParseArguments() public abstract method

Parse application-specific arguments.
public abstract ParseArguments ( string args ) : void
args string The array of commandline arguments
return void

Run() public method

Run the application
public Run ( string args ) : void
args string The array of commandline arguments
return void

ShowUsage() public abstract method

Display usage information for this application
public abstract ShowUsage ( ) : void
return void

ThrowIfEmpty() protected static method

Throws an ArgumentException if the given parameter value is empty
protected static ThrowIfEmpty ( string value, string parameter ) : void
value string
parameter string
return void

Property Details

_Command protected property

The command to be executed
protected IConsoleCommand _Command
return IConsoleCommand