IApplicationInvoker.

Invoke(string, IEnumerable<string>, string, Action<StringDictionary>, DataReceivedEventHandler, DataReceivedEventHandler, bool) Method

Summary

Invokes the application and returns the exit code.

Syntax

int Invoke(string applicationPath, IEnumerable<string> arguments, string workingDirectory = null, Action<StringDictionary> updateEnvironmentVariables = null, DataReceivedEventHandler standardOutputHandler = null, DataReceivedEventHandler standardErrorHandler = null, bool logEnvironmentVariables = false)

Parameters

Name Type Description
applicationPath string The path to the command line executable.
arguments IEnumerable<string> The ordered list of command line arguments that should be passed to the application.
workingDirectory string The full path to the working directory.
updateEnvironmentVariables Action<StringDictionary> The function that is used to update the list of environment variables for the application.
standardOutputHandler DataReceivedEventHandler The event handler that handles the standard output stream of the command line application. If no value is provided then all messages are logged.
standardErrorHandler DataReceivedEventHandler The event handler that handles the standard error stream of the command line application. If no value is provided then all messages are logged as errors.
logEnvironmentVariables bool A flag that indicates whether the environment variables for the process should be logged.

Return Value

Type Description
int The exit code of the application. If the application does not return an exit code then zero is returned.