Delen via


VersionControlPath.Combine Method (String, String, String, PathLength)

Given a base local path, base server path and target local path computes the target server path. This is done by generating the relative path for the local paths, converting that to a server relative path and combining it with the base server path. Note: This method will throw an invalid path exception if it cannot generate the target server path. Possible reasons for this include: 1) local paths are on different drives and are not relative. 2) combining the calculated relative path with the base server path results in a "negative folder depth" (i.e. directory above root, $/). Examples: Combine(@"c:\myproj\abc\efg", @"c:\\myproj\\abc\\blech", @"$/foo") -> @"$/blech" Combine(@"c:\myproj\abc\efg", @"c:\\myproj\\abc\\efg\\x", @"$/bar") -> @"$/efg/x" Combine(@"c:\myproj\abc\efg", @"c:\\yourproj\\abc\\efg\\x", @"$/bar") -> @"InvalidPathException" Combine(@"c:\myproj\abc\efg", @"c:\\yourproj\\abc\\efg", @"$/myproj/abc/efg") -> @"$/yourproj/abc/efg"

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

Syntax

'Declaration
Public Shared Function Combine ( _
    baseLocalPath As String, _
    targetLocalPath As String, _
    baseServerPath As String, _
    maxServerPathLength As PathLength _
) As String
public static string Combine(
    string baseLocalPath,
    string targetLocalPath,
    string baseServerPath,
    PathLength maxServerPathLength
)
public:
static String^ Combine(
    String^ baseLocalPath, 
    String^ targetLocalPath, 
    String^ baseServerPath, 
    PathLength maxServerPathLength
)
static member Combine : 
        baseLocalPath:string * 
        targetLocalPath:string * 
        baseServerPath:string * 
        maxServerPathLength:PathLength -> string
public static function Combine(
    baseLocalPath : String, 
    targetLocalPath : String, 
    baseServerPath : String, 
    maxServerPathLength : PathLength
) : String

Parameters

  • baseLocalPath
    Type: System.String

    The source item's local path.

  • targetLocalPath
    Type: System.String

    The target item's local path.

  • baseServerPath
    Type: System.String

    The source item's server path.

Return Value

Type: System.String
The target item's absolute server path.

.NET Framework Security

See Also

Reference

VersionControlPath Class

Combine Overload

Microsoft.TeamFoundation.VersionControl.Common Namespace