Show / Hide Table of Contents

Interface IEnvironment

Component that encapsulates the process environment, including environment variables.

Namespace: GitCredentialManager
Assembly: Algenta.Colectica.Repository.Client.dll
Syntax
public interface IEnvironment

Properties

Variables

Current process environment variables.

Declaration
IReadOnlyDictionary<string, string> Variables { get; }
Property Value
Type Description
IReadOnlyDictionary<string, string>

Methods

AddDirectoryToPath(string, EnvironmentVariableTarget)

Add the directory to the path.

Declaration
void AddDirectoryToPath(string directoryPath, EnvironmentVariableTarget target)
Parameters
Type Name Description
string directoryPath

Path to directory to add to the path.

EnvironmentVariableTarget target

The level of the path environment variable that should be modified.

CreateProcess(string, string, bool, string)

Create a process ready to start, with redirected streams.

Declaration
Process CreateProcess(string path, string args, bool useShellExecute, string workingDirectory)
Parameters
Type Name Description
string path

Absolute file path of executable or command to start.

string args

Command line arguments to pass to executable.

bool useShellExecute

True to resolve path using the OS shell, false to use as an absolute file path.

string workingDirectory

Working directory for the new process.

Returns
Type Description
Process

Process object ready to start.

IsDirectoryOnPath(string)

Check if the given directory exists on the path.

Declaration
bool IsDirectoryOnPath(string directoryPath)
Parameters
Type Name Description
string directoryPath

Path to directory to check for existence on the path.

Returns
Type Description
bool

True if the directory is on the path, false otherwise.

RemoveDirectoryFromPath(string, EnvironmentVariableTarget)

Remove the directory from the path.

Declaration
void RemoveDirectoryFromPath(string directoryPath, EnvironmentVariableTarget target)
Parameters
Type Name Description
string directoryPath

Path to directory to remove from the path.

EnvironmentVariableTarget target

The level of the path environment variable that should be modified.

TryLocateExecutable(string, out string)

Locate an executable on the current PATH.

Declaration
bool TryLocateExecutable(string program, out string path)
Parameters
Type Name Description
string program

Executable program name.

string path

First instance of the found executable program.

Returns
Type Description
bool

True if the executable was found, false otherwise.

Extension Methods

EnvironmentExtensions.CreateProcess(IEnvironment, string, string)
EnvironmentExtensions.CreateProcess(IEnvironment, string, string, bool)
EnvironmentExtensions.LocateExecutable(IEnvironment, string)
In this article
Back to top Generated by DocFX