다음을 통해 공유


PackageUtilities.MakeRelativeIfRooted Method

Returns a relative path if the specified file path is absolute and if it's in the same folder as the URL or a child folder of the URL.

Namespace:  Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.12.0 (in Microsoft.VisualStudio.Shell.12.0.dll)

Syntax

'Declaration
Public Shared Function MakeRelativeIfRooted ( _
    fileName As String, _
    url As Url _
) As String
public static string MakeRelativeIfRooted(
    string fileName,
    Url url
)
public:
static String^ MakeRelativeIfRooted(
    String^ fileName, 
    Url^ url
)
static member MakeRelativeIfRooted : 
        fileName:string * 
        url:Url -> string
public static function MakeRelativeIfRooted(
    fileName : String, 
    url : Url
) : String

Parameters

  • fileName
    Type: String

    The path to convert.

Return Value

Type: String
The relative path of the file.

Remarks

If fileName is already relative, or if it is absolute and does not overlap url, this method returns fileName. Otherwise, it returns the portion of the path that does not overlap url.

.NET Framework Security

See Also

Reference

PackageUtilities Class

Microsoft.VisualStudio.Shell Namespace