Share via


VersionControlPath.MakeRelative Method (String, String)

Given a path and folder, returns the path relative to the folder. If the path is not under the folder the path is returned unmodified. Both path and folder are assumed to be in canonical form. Examples: MakeRelative(@"$/src/project/abc.cpp", @"$/src") -> @"project/abc.cpp" MakeRelative(@"$/src/project/abc.cpp", @"$/specs") -> @"$/src/project/abc.cpp" MakeRelative(@"$/src/project/abc.cpp", @"$/src/proj") -> @"$/src/project/abc.cpp"

Namespace:  Microsoft.TeamFoundation.VersionControl.Common
Assembly:  Microsoft.TeamFoundation.VersionControl.Common (in Microsoft.TeamFoundation.VersionControl.Common.dll)

Syntax

'Declaration
Public Shared Function MakeRelative ( _
    item As String, _
    folder As String _
) As String
public static string MakeRelative(
    string item,
    string folder
)
public:
static String^ MakeRelative(
    String^ item, 
    String^ folder
)
static member MakeRelative : 
        item:string * 
        folder:string -> string
public static function MakeRelative(
    item : String, 
    folder : String
) : String

Parameters

Return Value

Type: System.String
Relative path.

.NET Framework Security

See Also

Reference

VersionControlPath Class

MakeRelative Overload

Microsoft.TeamFoundation.VersionControl.Common Namespace