本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol.ContainingNamespaceOrType方法的典型用法代码示例。如果您正苦于以下问题:C# MethodSymbol.ContainingNamespaceOrType方法的具体用法?C# MethodSymbol.ContainingNamespaceOrType怎么用?C# MethodSymbol.ContainingNamespaceOrType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.Symbols.MethodSymbol
的用法示例。
在下文中一共展示了MethodSymbol.ContainingNamespaceOrType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SequenceNumber
private static int SequenceNumber(MethodSymbol method)
{
// return a unique sequence number for the async implementation class that is independent of the compilation state.
int count = 0;
foreach (var m in method.ContainingNamespaceOrType().GetMembers(method.Name))
{
count++;
if (method == m) return count;
}
// It is possible we did not find any such members, e.g. for methods that result from the translation of
// async lambdas. In that case the method has already been uniquely named, so there is no need to
// produce a unique sequence number for the corresponding class, which already includes the (unique) method name.
return count;
}