Table of Contents

Interface IProjectPathVariables

Namespace
NDepend.Project
Assembly
NDepend.API.dll

Represents the project path variables that can be use to handle complex path redirection scenarios.

public interface IProjectPathVariables
Extension Methods

Remarks

One or several Path Variables of a project can be overridden when starting NDepend.Console.exe with the command line argument switch /PathVariables.
The two path variables \((NdProjectDir)</i> and <i>\)(NdProjectOutputDir) are automatically set and they are read-only.
\((NdProjectDir)</i> is automatically set to project.<xref href="NDepend.Project.IProject.Properties" data-throw-if-not-resolved="false"></xref>.<xref href="NDepend.Project.IProjectProperties.FilePath" data-throw-if-not-resolved="false"></xref>.<xref href="NDepend.Path.IPath.ParentDirectoryPath" data-throw-if-not-resolved="false"></xref>.<br /><i>\)(NdProjectOutputDir) is automatically set to project.Properties.OutputDir.

Property (1)

PathVariables

Gets all path variables defined for this project.

IReadOnlyList<PathVariable> PathVariables { get; }

Property Value

IReadOnlyList<PathVariable>

Methods (5)

TryAdd(string, string)

Try add a path variable to this project collection of path variables.

bool TryAdd(string pathVariableName, string pathVariableValue)

Parameters

pathVariableName string

The path variable name.

pathVariableValue string

The path variable value.

Returns

bool

Remarks

Returns false if pathVariableName is NdProjectDir or NdProjectOutputDir.
Returns false if a variable with pathVariableName already exists.
If this method modifies a state, this method returns true and the event IProject.SettingsChanged is triggered with the flag ProjectSettings.PathVariables activated.

TryChangeName(string, string)

Try change the name of a path variable.

bool TryChangeName(string oldPathVariableName, string newPathVariableName)

Parameters

oldPathVariableName string

The old path variable name.

newPathVariableName string

The new path variable value.

Returns

bool

Remarks

Returns false if oldPathVariableName is NdProjectDir or NdProjectOutputDir.
Returns false if no variable with the name oldPathVariableName exists.
If this method modifies a state, this method returns true and the event IProject.SettingsChanged is triggered with the flag ProjectSettings.PathVariables activated.

TryChangeValue(string, string)

Try change the value of a path variable.

bool TryChangeValue(string pathVariableName, string newPathVariableValue)

Parameters

pathVariableName string

The path variable name.

newPathVariableValue string

The new path variable value.

Returns

bool

Remarks

Returns false if pathVariableName is NdProjectDir or NdProjectOutputDir.
Returns false if no variable with the name pathVariableName exists.
If this method modifies a state, this method returns true and the event IProject.SettingsChanged is triggered with the flag ProjectSettings.PathVariables activated.

TryGetPathVariableValue(string, out string)

Try obtain the value of a path variable value from its name.

bool TryGetPathVariableValue(string pathVariableName, out string pathVariableValue)

Parameters

pathVariableName string

The path variable name.

pathVariableValue string

The path variable value found, if any path variable with pathVariableName is found.

Returns

bool

true if a path variable with pathVariableName is found.

Remarks

Path variable naming match is case insensitive.

TryRemove(string)

Try remove a path variable from this project collection of path variables.

bool TryRemove(string pathVariableName)

Parameters

pathVariableName string

The path variable to remove, name.

Returns

bool

Remarks

Returns false if no path variable with pathVariableName and read-write access right, is defined.
If this method modifies a state, this method returns true and the event IProject.SettingsChanged is triggered with the flag ProjectSettings.PathVariables activated.