Sites

Menu

RedirectedProcess Class

Namespace: Improbable.Gdk.Tools
GDK package: Tools
Source

Runs a windowless process.


Static Methods

Command Source
RedirectedProcess Command(string command)

Creates the redirected process for the command.

Parameters
  • string command : The filename to run.


Methods

WithArgs Source
RedirectedProcess WithArgs(params string [] arguments)

Adds arguments to process command call.

Parameters
  • params string [] arguments : Parameters that will be passed to the command.
InDirectory Source
RedirectedProcess InDirectory(string directory)

Sets which directory run the process in.

Parameters
  • string directory : Working directory of the process.
AddOutputProcessing Source
RedirectedProcess AddOutputProcessing(Action<string> outputProcessor)

Adds custom processing for regular output of process.

Parameters
  • Action<string> outputProcessor : Processing action for regular output.

Notes:
  • The outputProcessor callback will be ran on a different thread to the one which registered it.
AddErrorProcessing Source
RedirectedProcess AddErrorProcessing(Action<string> errorProcessor)

Adds custom processing for error output of process.

Parameters
  • Action<string> errorProcessor : Processing action for error output.

Notes:
  • The errorProcessor callback will be ran on a different thread to the one which registered it.
RedirectOutputOptions Source
RedirectedProcess RedirectOutputOptions(OutputRedirectBehaviour redirectBehaviour)

Adds custom processing for error output of process.

Parameters
Run Source
RedirectedProcessResult Run()

Runs the redirected process and waits for it to return.
RunAsync Source
Task<RedirectedProcessResult> RunAsync(CancellationToken token = default)

Runs the redirected process and returns a task which can be waited on.

Returns:
A task which would return the exit code and output.

Parameters
  • CancellationToken token : A cancellation token which can be used for cancelling the underlying process. Default is CancellationToken.None.

Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums