PackageUtilities.MakeRelativeIfRooted Method
Returns a relative path if the specified file path is absolute and if it is in the same folder as the URL or in a child folder of the URL.
Namespace: Microsoft.VisualStudio.Shell
Assemblies: Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
Syntax
'宣言
Public Shared Function MakeRelativeIfRooted ( _
fileName As String, _
url As Url _
) As String
'使用
Dim fileName As String
Dim url As Url
Dim returnValue As String
returnValue = PackageUtilities.MakeRelativeIfRooted(fileName, _
url)
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: System.String
The path to convert.
- url
Type: Microsoft.VisualStudio.Shell.Url
The base URL.
Return Value
Type: System.String
The relative path to 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
- 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.