C# 클래스 CodeArtEng.Diagnostics.ProcessExecutor

Execute Console based application without showing the console window.
파일 보기 프로젝트 열기: Code-Artist/CodeArtEng.Diagnostics

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