本文整理汇总了C#中ISymUnmanagedReader.GetMethodFromDocumentPosition方法的典型用法代码示例。如果您正苦于以下问题:C# ISymUnmanagedReader.GetMethodFromDocumentPosition方法的具体用法?C# ISymUnmanagedReader.GetMethodFromDocumentPosition怎么用?C# ISymUnmanagedReader.GetMethodFromDocumentPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISymUnmanagedReader
的用法示例。
在下文中一共展示了ISymUnmanagedReader.GetMethodFromDocumentPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetMethodTokensForEachLine
private int[][] GetMethodTokensForEachLine(ISymUnmanagedReader symReader, ISymUnmanagedDocument symDocument, int minZeroBasedLine, int maxZeroBasedLine)
{
var result = new List<int[]>();
for (int line = minZeroBasedLine; line <= maxZeroBasedLine; line++)
{
int[] allMethodTokens = GetMethodTokensFromDocumentPosition(symReader, symDocument, line, 0);
ISymUnmanagedMethod method;
int hr = symReader.GetMethodFromDocumentPosition(symDocument, line, 1, out method);
if (hr != HResult.S_OK)
{
Assert.Equal(HResult.E_FAIL, hr);
Assert.Equal(0, allMethodTokens.Length);
}
else
{
int primaryToken;
Assert.Equal(HResult.S_OK, method.GetToken(out primaryToken));
Assert.Equal(primaryToken, allMethodTokens.First());
}
result.Add(allMethodTokens);
}
return result.ToArray();
}
示例2: TestGetMethodFromDocumentPosition
private void TestGetMethodFromDocumentPosition(
ISymUnmanagedReader symReader,
ISymUnmanagedDocument symDocument,
int zeroBasedLine,
int zeroBasedColumn,
int expectedToken)
{
ISymUnmanagedMethod method;
Assert.Equal(HResult.S_OK, symReader.GetMethodFromDocumentPosition(symDocument, zeroBasedLine, zeroBasedColumn, out method));
int token;
Assert.Equal(HResult.S_OK, method.GetToken(out token));
Assert.Equal(expectedToken, token);
}