Class ProcessControlWrapper
Inheritance
ProcessControlWrapper
Assembly: LemonEdge.Tools.ProcessUtilities.dll
public sealed class ProcessControlWrapper : IProcessControlWrapper
Constructors
Declaration
public ProcessControlWrapper()
Methods
Declaration
public void AddArgument(ProcessStartInfo processStartInfo, string argument)
Parameters
Declaration
public ProcessStartInfo CreateProcess(string exePath)
Parameters
Type |
Name |
Description |
string |
exePath |
|
Returns
Returns a Process for the given process ID
Declaration
public Process GetProcessById(int processId)
Parameters
Type |
Name |
Description |
int |
processId |
|
Returns
Gets the process ID by the specified process name.
Declaration
public int GetProcessesIdByName(string processName)
Parameters
Type |
Name |
Description |
string |
processName |
The name of the process for which to retrieve the ID.
|
Returns
Type |
Description |
int |
The process ID if found; otherwise, a default value (-1).
|
Declaration
public void Kill(Process process)
Parameters
Type |
Name |
Description |
Process |
process |
The process
|
Declaration
public void SetUseShellExecute(ProcessStartInfo processStartInfo, bool useShellExecute)
Parameters
Type |
Name |
Description |
ProcessStartInfo |
processStartInfo |
|
bool |
useShellExecute |
Whether to use ShellExecute
|
Declaration
public void SetWorkingDirectory(ProcessStartInfo processStartInfo, string path)
Parameters
Declaration
public Process Start(ProcessStartInfo processStartInfo)
Parameters
Returns
Waits for a process to exit.
Declaration
public Task WaitForExitAsync(Process process, CancellationToken cancellationToken = default)
Parameters
Returns
Implements
Extension Methods