本文整理汇总了C#中ISymbol.IsModuleType方法的典型用法代码示例。如果您正苦于以下问题:C# ISymbol.IsModuleType方法的具体用法?C# ISymbol.IsModuleType怎么用?C# ISymbol.IsModuleType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISymbol
的用法示例。
在下文中一共展示了ISymbol.IsModuleType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdatePropertiesForNode
private static void UpdatePropertiesForNode(ISymbol symbol, GraphNode node)
{
// Set accessibility properties
switch (symbol.DeclaredAccessibility)
{
case Accessibility.Public:
node[Properties.IsPublic] = true;
break;
case Accessibility.Internal:
node[Properties.IsInternal] = true;
break;
case Accessibility.Protected:
node[Properties.IsProtected] = true;
break;
case Accessibility.Private:
node[Properties.IsPrivate] = true;
break;
case Accessibility.ProtectedOrInternal:
node[Properties.IsProtectedOrInternal] = true;
break;
case Accessibility.ProtectedAndInternal:
node[Properties.IsProtected] = true;
node[Properties.IsInternal] = true;
break;
case Accessibility.NotApplicable:
break;
}
// Set common properties
if (symbol.IsAbstract)
{
node[Properties.IsAbstract] = true;
}
if (symbol.IsSealed)
{
// For VB module, do not set IsFinal since it's not inheritable.
if (!symbol.IsModuleType())
{
node[Properties.IsFinal] = true;
}
}
if (symbol.IsStatic)
{
node[Properties.IsStatic] = true;
}
if (symbol.IsVirtual)
{
node[Properties.IsVirtual] = true;
}
if (symbol.IsOverride)
{
// The property name is a misnomer, but this is what the previous providers do.
node[Microsoft.VisualStudio.Progression.DgmlProperties.IsOverloaded] = true;
}
// Set type-specific properties
var typeSymbol = symbol as ITypeSymbol;
if (typeSymbol != null && typeSymbol.IsAnonymousType)
{
node[Properties.IsAnonymous] = true;
}
else if (symbol is IMethodSymbol)
{
UpdateMethodPropertiesForNode((IMethodSymbol)symbol, node);
}
}