Class ProcessRunner
Helper class for running processes.
Implements
Inherited Members
Namespace: Acoustics.Shared
Assembly: Acoustics.Shared.dll
Syntax
public class ProcessRunner : IDisposable
Constructors
| Improve this Doc View SourceProcessRunner(String)
Initializes a new instance of the Process
Declaration
public ProcessRunner(string filePath)
Parameters
Type | Name | Description |
---|---|---|
String | filePath | The file path. |
Remarks
The.
KillProcessOnWaitTimeout
flag was removed to control complexity.
Exceptions
Type | Condition |
---|---|
File |
Thrown if |
Properties
| Improve this Doc View SourceErrorOutput
Gets ErrorOutput.
Declaration
public string ErrorOutput { get; }
Property Value
Type | Description |
---|---|
String |
ExecutableFile
Gets ExecutableFile.
Declaration
public FileInfo ExecutableFile { get; }
Property Value
Type | Description |
---|---|
File |
ExitCode
Declaration
public int ExitCode { get; }
Property Value
Type | Description |
---|---|
Int32 |
FailedRunOutput
Declaration
public IEnumerable<string> FailedRunOutput { get; }
Property Value
Type | Description |
---|---|
IEnumerable<String> |
MaxRetries
Gets or sets retry running process this many times if it is killed after running longer than WaitForExitMilliseconds. Defaults to 0 (no retries).
Declaration
public int MaxRetries { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
StandardOutput
Gets StandardOutput.
Declaration
public string StandardOutput { get; }
Property Value
Type | Description |
---|---|
String |
WaitForExit
Gets or sets a value indicating whether wait for process to exit if true. Defaults to true.
Declaration
public bool WaitForExit { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
WaitForExitMilliseconds
Gets or sets wait for the set number of milliseconds for the process to exit.
Declaration
public int WaitForExitMilliseconds { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
The default value.
-1
, or any value less than. 0
,
means we will wait indefinitely for process exit.
Methods
| Improve this Doc View SourceBuildLogOutput()
Get a string representing the settings and results of this ProcessRunner.
Declaration
public string BuildLogOutput()
Returns
Type | Description |
---|---|
String |
Dispose()
Declaration
public void Dispose()
Run(String, String)
Run the process with
arguments
in the workingDirectory
.
Waits indefinitely for the process to exit.
Declaration
public void Run(string arguments, string workingDirectory)
Parameters
Type | Name | Description |
---|---|---|
String | arguments | The arguments. |
String | workingDirectory | The working directory. |
Stop()
Stop the process immediately.
Declaration
public void Stop()