Interface IProjectPathVariables
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
Methods (5)
TryAdd(string, string)
Try add a path variable to this project collection of path variables.
bool TryAdd(string pathVariableName, string pathVariableValue)
Parameters
Returns
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
oldPathVariableNamestringThe old path variable name.
newPathVariableNamestringThe new path variable value.
Returns
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
pathVariableNamestringThe path variable name.
newPathVariableValuestringThe new path variable value.
Returns
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
pathVariableNamestringThe path variable name.
pathVariableValuestringThe path variable value found, if any path variable with
pathVariableNameis found.
Returns
- bool
true if a path variable with
pathVariableNameis 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
pathVariableNamestringThe path variable to remove, name.
Returns
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.