C# Класс CodeArtEng.Diagnostics.ProcessExecutor

Execute Console based application without showing the console window.
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
DisposeProcessHandler void
KillProcessAndChildren void
process_ErrorDataReceived void
process_Exited void
process_OutputDataReceived void

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

Метод Описание
Abort ( ) : void

Stop the current process and all its child process.

Execute ( bool waitForExit = true ) : ProcessResult

Execute process and return result in the form of ProcessResult.

No exception is expected from this application. Execution error will be reflected in ExitCode.

ProcessExecutor ( string name = "Unnamed" ) : System

Constructor

RedirectOutputToFile ( string logFile ) : void

Redirect standard output and standrad error to file. By default, standard output and standard error are stored in ProcessResult which returned at the end of Execute()

Validate ( ) : void

Check if the specific tool exists.

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

Метод Описание
Version ( string command ) : System.Version

Get tools version.

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

Метод Описание
DisposeProcessHandler ( ) : void
KillProcessAndChildren ( int pid ) : void
process_ErrorDataReceived ( object sender, DataReceivedEventArgs e ) : void
process_Exited ( object sender, EventArgs e ) : void
process_OutputDataReceived ( object sender, DataReceivedEventArgs e ) : void

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

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

Stop the current process and all its child process.
public Abort ( ) : void
Результат void

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

Execute process and return result in the form of ProcessResult.
No exception is expected from this application. Execution error will be reflected in ExitCode.
public Execute ( bool waitForExit = true ) : ProcessResult
waitForExit bool Set to true to wait until process exit, else return once process started.
Результат ProcessResult

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

Constructor
public ProcessExecutor ( string name = "Unnamed" ) : System
name string Instance name
Результат System

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

Redirect standard output and standrad error to file. By default, standard output and standard error are stored in ProcessResult which returned at the end of Execute()
public RedirectOutputToFile ( string logFile ) : void
logFile string Target file to store output logs.
Результат void

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

Check if the specific tool exists.
public Validate ( ) : void
Результат void

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

Get tools version.
protected Version ( string command ) : System.Version
command string Command to retrieve version number, e.g. "/?", "--version"
Результат System.Version