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
item
Type: System.StringPath to make relative.
folder
Type: System.StringFolder to make it relative to.
Return Value
Type: System.String
Relative path.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.