IProcessHandle Interface

Represents a process handle used by ProcessWrapper.

public interface IProcessHandle : IDisposable
Implements

Properties

NameDescription
ErrorStreamGets the process standard error stream.
ExitCodeGets the process exit code.
HasExitedGets a value indicating whether the process has exited.
IdGets the process identifier.
InputStreamGets the process standard input stream.
OutputStreamGets the process standard output stream.
SafeProcessHandleGets the process safe handle, or null if it is not available.

ErrorStream

Gets the process standard error stream.

Stream ErrorStream { get; }

Property value

Stream

ExitCode

Gets the process exit code.

int ExitCode { get; }

Property value

int

HasExited

Gets a value indicating whether the process has exited.

bool HasExited { get; }

Property value

bool

Id

Gets the process identifier.

int Id { get; }

Property value

int

InputStream

Gets the process standard input stream.

Stream InputStream { get; }

Property value

Stream

OutputStream

Gets the process standard output stream.

Stream OutputStream { get; }

Property value

Stream

SafeProcessHandle

Gets the process safe handle, or null if it is not available.

SafeProcessHandle? SafeProcessHandle { get; }

Property value

SafeProcessHandle?

Methods

NameDescription
Kill(bool)Kills the process.
Start()Starts the process.
WaitForExitAsync(CancellationToken)Asynchronously waits for the process to exit.

Kill(bool)

Kills the process.

void Kill(bool entireProcessTree = true)

Parameters

entireProcessTree bool
true to kill the entire process tree.

Start()

Starts the process.

bool Start()

Returns

bool true if the process starts successfully; otherwise, false.

WaitForExitAsync(CancellationToken)

Asynchronously waits for the process to exit.

Task WaitForExitAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken
A token to cancel waiting.

Returns

Task