NDepend.API Documentation
GetRelativePathFrom Method (IAbsolutePath)
NDepend.Path Namespace > IAbsolutePath Interface : GetRelativePathFrom Method
The pivot directory from which the relative path is computed.
Returns a new relative path representing this relative path to pivotDirectory.
Syntax

Parameters

pivotDirectory
The pivot directory from which the relative path is computed.
Exceptions
ExceptionDescription
pivotDirectory is not on the same drive as this file's drive.
Remarks
If this path is "C:\Dir1\Dir2\File.txt" and pivotDirectory is "C:\Dir1\Dir3", the returned relative directory is a IRelativeFilePath "..\Dir2\File.txt". If this path is "C:\Dir1\Dir2" and pivotDirectory is "C:\Dir1\Dir3", the returned relative directory is a IRelativeDirectoryPath "..\Dir2". This method is hidden in IAbsoluteFilePath and IAbsoluteDirectoryPath to get a typed result. This file or directory nor pivotDirectory need to exist for this operation to complete properly.
Requirements

Target Platforms: Windows 11, 10, 8, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

IAbsolutePath Interface
IAbsolutePath Members