C# Class SlavaGu.ConsoleAppLauncher.ConsoleApp

Inheritance: IConsoleApp
Afficher le fichier Open project: slavagu/ConsoleAppLauncher Class Usage Examples

Méthodes publiques

Méthode Description
ConsoleApp ( string fileName, string cmdLine ) : System

ConsoleApp constructor

Dispose ( ) : void
Run ( string fileName, string cmdLine = null ) : System.Result

Run console app synchronously and capture all its output including standard error stream.

Run ( ) : void

Start the app.

Stop ( ConsoleSpecialKey closeKey = ConsoleSpecialKey.ControlC, int forceCloseMillisecondsTimeout = Timeout.Infinite ) : void

Stop the app.

WaitForExit ( int millisecondsTimeout = Timeout.Infinite ) : bool

Wait until the app exits.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void
OnConsoleOutput ( ConsoleOutputEventArgs e ) : void
OnExited ( EventArgs e ) : void

Private Methods

Méthode Description
CloseConsole ( ConsoleSpecialKey closeKey, int forceCloseMillisecondsTimeout ) : void
ConsoleCtrlHandler ( Win32 ctrlType ) : bool
DispatchProcessOutput ( ) : void
FreeProcessResources ( ) : void
HandleProcessExit ( ) : void
MonitoringHandler ( object obj ) : void
OnErrorLineReceived ( object sender, DataReceivedEventArgs e ) : void
OnOutputLineReceived ( object sender, DataReceivedEventArgs e ) : void
OnProcessExited ( object sender, EventArgs e ) : void
StartProcessAsync ( ) : void
ThrowIfDisposed ( ) : void

Method Details

ConsoleApp() public méthode

ConsoleApp constructor
public ConsoleApp ( string fileName, string cmdLine ) : System
fileName string File name or DOS command
cmdLine string Command-line arguments
Résultat System

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

OnConsoleOutput() protected méthode

protected OnConsoleOutput ( ConsoleOutputEventArgs e ) : void
e ConsoleOutputEventArgs
Résultat void

OnExited() protected méthode

protected OnExited ( EventArgs e ) : void
e System.EventArgs
Résultat void

Run() public static méthode

Run console app synchronously and capture all its output including standard error stream.
public static Run ( string fileName, string cmdLine = null ) : System.Result
fileName string File name or DOS command
cmdLine string Command-line arguments
Résultat System.Result

Run() public méthode

Start the app.
public Run ( ) : void
Résultat void

Stop() public méthode

Stop the app.
public Stop ( ConsoleSpecialKey closeKey = ConsoleSpecialKey.ControlC, int forceCloseMillisecondsTimeout = Timeout.Infinite ) : void
closeKey ConsoleSpecialKey Special key to send to close the app [default=Ctrl-C]
forceCloseMillisecondsTimeout int Timeout to wait before closing the app forcefully [default=infinite]
Résultat void

WaitForExit() public méthode

Wait until the app exits.
public WaitForExit ( int millisecondsTimeout = Timeout.Infinite ) : bool
millisecondsTimeout int Timeout to wait until the app is exited [default=infinite]
Résultat bool