Zero Install .NET API 2.20.0
ZeroInstall.Services.Executors.EnvironmentBuilder Class Reference

Fluent-style builder for a process execution environment for a Selections document. More...

Inheritance diagram for ZeroInstall.Services.Executors.EnvironmentBuilder:
ZeroInstall.Services.Executors.IEnvironmentBuilder

Public Member Functions

void SetEnvironmentVariable (string key, string value)
 Adds an environment variable to the execution environment. May not be called after Inject has been called. More...
 
IEnvironmentBuilder Inject (Selections selections, string? overrideMain=null)
 Sets the Selections to be injected. Must be called before any methods of the IEnvironmentBuilder interface are used. May not be called more than once. More...
 
IEnvironmentBuilder AddWrapper (string? wrapper)
 Instead of executing the selected program directly, pass it as an argument to this program. Useful for debuggers. May contain command-line arguments. Whitespaces must be escaped! More...
 
IEnvironmentBuilder AddArguments (params string[] arguments)
 Appends user specified arguments to the command-line. More...
 
ProcessStartInfo ToStartInfo ()
 Builds a ProcessStartInfo for starting the program. More...
 
Process Start ()
 Starts the program. More...
 

Detailed Description

Fluent-style builder for a process execution environment for a Selections document.

Member Function Documentation

◆ AddArguments()

IEnvironmentBuilder ZeroInstall.Services.Executors.EnvironmentBuilder.AddArguments ( params string[]  arguments)
inline

Appends user specified arguments to the command-line.

Implements ZeroInstall.Services.Executors.IEnvironmentBuilder.

◆ AddWrapper()

IEnvironmentBuilder ZeroInstall.Services.Executors.EnvironmentBuilder.AddWrapper ( string?  wrapper)
inline

Instead of executing the selected program directly, pass it as an argument to this program. Useful for debuggers. May contain command-line arguments. Whitespaces must be escaped!

Implements ZeroInstall.Services.Executors.IEnvironmentBuilder.

◆ Inject()

IEnvironmentBuilder ZeroInstall.Services.Executors.EnvironmentBuilder.Inject ( Selections  selections,
string?  overrideMain = null 
)
inline

Sets the Selections to be injected. Must be called before any methods of the IEnvironmentBuilder interface are used. May not be called more than once.

Parameters
selectionsThe set of Implementations be injected into the execution environment.
overrideMainAn alternative executable to to run from the main Implementation instead of Element.Main. May not contain command-line arguments! Whitespaces do not need to be escaped.
Exceptions
ImplementationNotFoundExceptionOne of the Implementations is not cached yet.
ExecutorExceptionThe executor was unable to process the Selections.
IOExceptionA problem occurred while writing a file.
UnauthorizedAccessExceptionWrite access to a file is not permitted.
Returns
The execution environment. Reference to self for fluent API use.

◆ SetEnvironmentVariable()

void ZeroInstall.Services.Executors.EnvironmentBuilder.SetEnvironmentVariable ( string  key,
string  value 
)
inline

Adds an environment variable to the execution environment. May not be called after Inject has been called.

Parameters
keyThe name of the environment variable.
valueThe value to set the environment variable to.
Exceptions
ImplementationNotFoundExceptionOne of the Implementations is not cached yet.
ExecutorExceptionThe executor was unable to process the Selections.
IOExceptionA problem occurred while writing a file.
UnauthorizedAccessExceptionWrite access to a file is not permitted.
Returns
The execution environment. Reference to self for fluent API use.

Must be called before using other methods on the object. May not be called more than once.

◆ Start()

Process ZeroInstall.Services.Executors.EnvironmentBuilder.Start ( )

Starts the program.

Implements ZeroInstall.Services.Executors.IEnvironmentBuilder.

◆ ToStartInfo()

ProcessStartInfo ZeroInstall.Services.Executors.EnvironmentBuilder.ToStartInfo ( )
inline

Builds a ProcessStartInfo for starting the program.

Implements ZeroInstall.Services.Executors.IEnvironmentBuilder.


The documentation for this class was generated from the following files: