本文整理汇总了C#中ISymUnmanagedDocument.GetUrl方法的典型用法代码示例。如果您正苦于以下问题:C# ISymUnmanagedDocument.GetUrl方法的具体用法?C# ISymUnmanagedDocument.GetUrl怎么用?C# ISymUnmanagedDocument.GetUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISymUnmanagedDocument
的用法示例。
在下文中一共展示了ISymUnmanagedDocument.GetUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateDocumentUrl
public static void ValidateDocumentUrl(ISymUnmanagedDocument document, string url)
{
int actualCount, actualCount2;
Assert.Equal(HResult.S_OK, document.GetUrl(0, out actualCount, null));
char[] actualUrl = new char[actualCount];
Assert.Equal(HResult.S_OK, document.GetUrl(actualCount, out actualCount2, actualUrl));
Assert.Equal(url, new string(actualUrl, 0, actualUrl.Length - 1));
}
示例2: GetUrl
private string GetUrl(ISymUnmanagedDocument doc)
{
lock (this)
{
if (_urlCache == null)
_urlCache = new Dictionary<ISymUnmanagedDocument, string>();
string url;
if (_urlCache.TryGetValue(doc, out url))
return url;
int urlLength;
ThrowExceptionForHR(doc.GetUrl(0, out urlLength, null));
// urlLength includes terminating '\0'
char[] urlBuffer = new char[urlLength];
ThrowExceptionForHR(doc.GetUrl(urlLength, out urlLength, urlBuffer));
url = new string(urlBuffer, 0, urlLength - 1);
_urlCache.Add(doc, url);
return url;
}
}