C# Class CodeArtEng.Diagnostics.ProcessExecutor

Execute Console based application without showing the console window.
Afficher le fichier Open project: Code-Artist/CodeArtEng.Diagnostics

Private Properties

Свойство Type Description
DisposeProcessHandler void
KillProcessAndChildren void
process_ErrorDataReceived void
process_Exited void
process_OutputDataReceived void

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
Version ( string command ) : System.Version

Get tools version.

Private Methods

Méthode Description
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

Method Details

Abort() public méthode

Stop the current process and all its child process.
public Abort ( ) : void
Résultat void

Execute() public méthode

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.
Résultat ProcessResult

ProcessExecutor() public méthode

Constructor
public ProcessExecutor ( string name = "Unnamed" ) : System
name string Instance name
Résultat System

RedirectOutputToFile() public méthode

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.
Résultat void

Validate() public méthode

Check if the specific tool exists.
public Validate ( ) : void
Résultat void

Version() protected méthode

Get tools version.
protected Version ( string command ) : System.Version
command string Command to retrieve version number, e.g. "/?", "--version"
Résultat System.Version