本文整理汇总了C#中TypeSymbol.CustomModifierCount方法的典型用法代码示例。如果您正苦于以下问题:C# TypeSymbol.CustomModifierCount方法的具体用法?C# TypeSymbol.CustomModifierCount怎么用?C# TypeSymbol.CustomModifierCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeSymbol
的用法示例。
在下文中一共展示了TypeSymbol.CustomModifierCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformType
private TypeSymbol TransformType(TypeSymbol type)
{
Debug.Assert(_index >= 0);
if (!HasFlag ||
PeekFlag() && type.SpecialType != SpecialType.System_Object)
{
// Bail, since flags are invalid.
return null;
}
switch (type.Kind)
{
case SymbolKind.ErrorType:
case SymbolKind.NamedType:
if (type.SpecialType == SpecialType.System_Object)
{
// Replace the given System.Object type with dynamic type if the corresponding dynamicTransformFlag is set to true.
return ConsumeFlag() ? DynamicTypeSymbol.Instance : type;
}
return TransformNamedType((NamedTypeSymbol)type);
case SymbolKind.ArrayType:
return TransformArrayType((ArrayTypeSymbol)type);
case SymbolKind.PointerType:
return TransformPointerType((PointerTypeSymbol)type);
case SymbolKind.DynamicType:
Debug.Assert(!_haveCustomModifierFlags, "This shouldn't happen during decoding.");
return ConsumeFlag()
? type
: _containingAssembly.GetSpecialType(SpecialType.System_Object);
default:
ConsumeFlag();
return HandleCustomModifiers(type.CustomModifierCount()) ? type : null;
}
}
示例2: TransformType
private TypeSymbol TransformType(TypeSymbol type)
{
Debug.Assert(index >= 0);
if (index >= dynamicTransformFlags.Length ||
dynamicTransformFlags[index] && type.SpecialType != SpecialType.System_Object)
{
return null;
}
switch (type.Kind)
{
case SymbolKind.ErrorType:
case SymbolKind.NamedType:
if (type.SpecialType == SpecialType.System_Object)
{
// Replace the given System.Object type with dynamic type if the corresponding dynamicTransformFlag is set to true.
return dynamicTransformFlags[index++] ? DynamicTypeSymbol.Instance : type;
}
return TransformNamedType((NamedTypeSymbol)type);
case SymbolKind.ArrayType:
return TransformArrayType((ArrayTypeSymbol)type);
case SymbolKind.PointerType:
return TransformPointerType((PointerTypeSymbol)type);
case SymbolKind.DynamicType:
Debug.Assert(!this.haveCustomModifierFlags, "This shouldn't happen during decoding.");
return dynamicTransformFlags[index++]
? type
: this.containingAssembly.GetSpecialType(SpecialType.System_Object);
default:
index++;
return HandleCustomModifiers(type.CustomModifierCount()) ? type : null;
}
}