C# Класс SlavaGu.ConsoleAppLauncher.ConsoleApp

Наследование: IConsoleApp
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void
OnConsoleOutput ( ConsoleOutputEventArgs e ) : void
OnExited ( EventArgs e ) : void

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

Метод Описание
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

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

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

ConsoleApp constructor
public ConsoleApp ( string fileName, string cmdLine ) : System
fileName string File name or DOS command
cmdLine string Command-line arguments
Результат System

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

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

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

OnConsoleOutput() защищенный Метод

protected OnConsoleOutput ( ConsoleOutputEventArgs e ) : void
e ConsoleOutputEventArgs
Результат void

OnExited() защищенный Метод

protected OnExited ( EventArgs e ) : void
e System.EventArgs
Результат void

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

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
Результат System.Result

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

Start the app.
public Run ( ) : void
Результат void

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

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]
Результат void

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

Wait until the app exits.
public WaitForExit ( int millisecondsTimeout = Timeout.Infinite ) : bool
millisecondsTimeout int Timeout to wait until the app is exited [default=infinite]
Результат bool