Class ProcessStarterFactory
Factory service for process starters.
Inheritance
Implements
Inherited Members
Namespace: Kephas.Diagnostics
Assembly: Kephas.Core.dll
Syntax
[OverridePriority(Priority.Low)]
public class ProcessStarterFactory : IProcessStarterFactory
Constructors
| Improve this Doc View SourceProcessStarterFactory(IAppRuntime)
Initializes a new instance of the ProcessStarterFactory class.
Declaration
public ProcessStarterFactory(IAppRuntime appRuntime)
Parameters
Type | Name | Description |
---|---|---|
IAppRuntime | appRuntime | The application runtime. |
Methods
| Improve this Doc View SourceCreateProcessStarter()
Creates the process launcher.
Declaration
public IProcessStarter CreateProcessStarter()
Returns
Type | Description |
---|---|
IProcessStarter | The new ProcessStarter. |
GetProcessStartInfo()
Gets the process start information.
Declaration
public ProcessStartInfo GetProcessStartInfo()
Returns
Type | Description |
---|---|
System.Diagnostics.ProcessStartInfo | The process start information. |
WithArguments(String[])
Sets the process arguments.
Declaration
public IProcessStarterFactory WithArguments(params string[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | args | A variable-length parameters list containing arguments. |
Returns
Type | Description |
---|---|
IProcessStarterFactory | This IProcessStarterFactory. |
WithEnvironmentVariable(String, String)
Sets an environment variable for the process.
Declaration
public IProcessStarterFactory WithEnvironmentVariable(string name, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The variable name. |
System.String | value | The variable value. |
Returns
Type | Description |
---|---|
IProcessStarterFactory | This IProcessStarterFactory. |
WithManagedExecutable(String)
Sets the executable file as a managed process.
Declaration
public IProcessStarterFactory WithManagedExecutable(string executableFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | executableFile | Full pathname of the executable file. |
Returns
Type | Description |
---|---|
IProcessStarterFactory | This IProcessStarterFactory. |
WithNativeExecutable(String)
Sets the executable file as an operating system native process.
Declaration
public IProcessStarterFactory WithNativeExecutable(string executableFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | executableFile | Full pathname of the executable file. |
Returns
Type | Description |
---|---|
IProcessStarterFactory | This IProcessStarterFactory. |
WithProcessStartInfoConfig(Action<ProcessStartInfo>)
With process information configuration.
Declaration
public IProcessStarterFactory WithProcessStartInfoConfig(Action<ProcessStartInfo> config)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Diagnostics.ProcessStartInfo> | config | The configuration. |
Returns
Type | Description |
---|---|
IProcessStarterFactory | This IProcessStarterFactory. |
WithShell(Boolean)
Indicates whether the process should use the shell execution (for console display).
Declaration
public IProcessStarterFactory WithShell(bool useShell = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | useShell | Optional. True to use shell. |
Returns
Type | Description |
---|---|
IProcessStarterFactory | This IProcessStarterFactory. |
WithWorkingDirectory(String)
Sets the process working directory.
Declaration
public IProcessStarterFactory WithWorkingDirectory(string workingDirectory)
Parameters
Type | Name | Description |
---|---|---|
System.String | workingDirectory | Pathname of the working directory. |
Returns
Type | Description |
---|---|
IProcessStarterFactory | This IProcessStarterFactory. |