Show / Hide Table of Contents

Class EnvironmentBase

Inheritance
object
EnvironmentBase
WindowsEnvironment
Implements
IEnvironment
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: GitCredentialManager
Assembly: Algenta.Colectica.Repository.Client.dll
Syntax
public abstract class EnvironmentBase : IEnvironment

Constructors

EnvironmentBase(IFileSystem)

Declaration
protected EnvironmentBase(IFileSystem fileSystem)
Parameters
Type Name Description
IFileSystem fileSystem

Properties

FileSystem

Declaration
protected IFileSystem FileSystem { get; }
Property Value
Type Description
IFileSystem

Trace

Declaration
protected ITrace Trace { get; }
Property Value
Type Description
ITrace

Variables

Current process environment variables.

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

Methods

AddDirectoryToPath(string, EnvironmentVariableTarget)

Add the directory to the path.

Declaration
public abstract 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
public virtual 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
public 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
public abstract 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.

SplitPathVariable(string)

Declaration
protected abstract string[] SplitPathVariable(string value)
Parameters
Type Name Description
string value
Returns
Type Description
string[]

TryLocateExecutable(string, out string)

Locate an executable on the current PATH.

Declaration
public virtual 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.

Implements

IEnvironment

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