C# Class GitForce.Exec

Contains functions to execute external console applications. Standard streams (stdout/stderr) are captured and returned. Command shell is not invoked as that would prevent capturing the streams. Internally, the invocation is asynchronous.
Show file Open project: gdevic/GitForce Class Usage Examples

Public Methods

Method Description
AsyncRun ( PStdoutDelegate pstdout, PStderrDelegate pstderr, PCompleteDelegate pcomplete ) : void
Exec ( string cmd, string args ) : System
Run ( string cmd, string args ) : ExecResult

Main command execution function. Upon completion, prints all errors to the log window.

Terminate ( ) : void

Terminate this job

Private Methods

Method Description
PErrorDataReceived ( object sender, DataReceivedEventArgs e ) : void

Callback that handles process printing to stderr Collect all strings into one stderr variable and call a custom handler.

POutputDataReceived ( object sender, DataReceivedEventArgs e ) : void

Callback that handles process printing to stdout. Collect all strings into one stdout variable and call a custom handler.

ThreadedRun ( object wait ) : void

Executes a job process and blocks until it completes.

Method Details

AsyncRun() public method

public AsyncRun ( PStdoutDelegate pstdout, PStderrDelegate pstderr, PCompleteDelegate pcomplete ) : void
pstdout PStdoutDelegate
pstderr PStderrDelegate
pcomplete PCompleteDelegate
return void

Exec() public method

public Exec ( string cmd, string args ) : System
cmd string
args string
return System

Run() public static method

Main command execution function. Upon completion, prints all errors to the log window.
public static Run ( string cmd, string args ) : ExecResult
cmd string
args string
return ExecResult

Terminate() public method

Terminate this job
public Terminate ( ) : void
return void