예제 #1
0
        void WriteTypeName(DmdType type, KeywordType keywordType)
        {
            switch (keywordType)
            {
            case KeywordType.Boolean:       OutputWrite("Boolean", BoxedTextColor.Keyword); return;

            case KeywordType.Byte:          OutputWrite("Byte", BoxedTextColor.Keyword); return;

            case KeywordType.Char:          OutputWrite("Char", BoxedTextColor.Keyword); return;

            case KeywordType.Date:          OutputWrite("Date", BoxedTextColor.Keyword); return;

            case KeywordType.Decimal:       OutputWrite("Decimal", BoxedTextColor.Keyword); return;

            case KeywordType.Double:        OutputWrite("Double", BoxedTextColor.Keyword); return;

            case KeywordType.Integer:       OutputWrite("Integer", BoxedTextColor.Keyword); return;

            case KeywordType.Long:          OutputWrite("Long", BoxedTextColor.Keyword); return;

            case KeywordType.Object:        OutputWrite("Object", BoxedTextColor.Keyword); return;

            case KeywordType.SByte:         OutputWrite("SByte", BoxedTextColor.Keyword); return;

            case KeywordType.Short:         OutputWrite("Short", BoxedTextColor.Keyword); return;

            case KeywordType.Single:        OutputWrite("Single", BoxedTextColor.Keyword); return;

            case KeywordType.String:        OutputWrite("String", BoxedTextColor.Keyword); return;

            case KeywordType.UInteger:      OutputWrite("UInteger", BoxedTextColor.Keyword); return;

            case KeywordType.ULong:         OutputWrite("ULong", BoxedTextColor.Keyword); return;

            case KeywordType.UShort:        OutputWrite("UShort", BoxedTextColor.Keyword); return;

            case KeywordType.NoKeyword:
                break;

            default:
                throw new InvalidOperationException();
            }

            WriteIdentifier(TypeFormatterUtils.RemoveGenericTick(type.MetadataName), TypeFormatterUtils.GetTypeColor(type, canBeModule: true));
            WriteTokenComment(type.MetadataToken);
        }
예제 #2
0
        void WriteTypeName(DmdType type, KeywordType keywordType)
        {
            switch (keywordType)
            {
            case KeywordType.Void:          OutputWrite("void", BoxedTextColor.Keyword); return;

            case KeywordType.Boolean:       OutputWrite("bool", BoxedTextColor.Keyword); return;

            case KeywordType.Char:          OutputWrite("char", BoxedTextColor.Keyword); return;

            case KeywordType.SByte:         OutputWrite("sbyte", BoxedTextColor.Keyword); return;

            case KeywordType.Byte:          OutputWrite("byte", BoxedTextColor.Keyword); return;

            case KeywordType.Int16:         OutputWrite("short", BoxedTextColor.Keyword); return;

            case KeywordType.UInt16:        OutputWrite("ushort", BoxedTextColor.Keyword); return;

            case KeywordType.Int32:         OutputWrite("int", BoxedTextColor.Keyword); return;

            case KeywordType.UInt32:        OutputWrite("uint", BoxedTextColor.Keyword); return;

            case KeywordType.Int64:         OutputWrite("long", BoxedTextColor.Keyword); return;

            case KeywordType.UInt64:        OutputWrite("ulong", BoxedTextColor.Keyword); return;

            case KeywordType.Single:        OutputWrite("float", BoxedTextColor.Keyword); return;

            case KeywordType.Double:        OutputWrite("double", BoxedTextColor.Keyword); return;

            case KeywordType.Object:        OutputWrite("object", BoxedTextColor.Keyword); return;

            case KeywordType.Decimal:       OutputWrite("decimal", BoxedTextColor.Keyword); return;

            case KeywordType.String:        OutputWrite("string", BoxedTextColor.Keyword); return;

            case KeywordType.NoKeyword:
                break;

            default:
                throw new InvalidOperationException();
            }

            WriteIdentifier(TypeFormatterUtils.RemoveGenericTick(type.MetadataName), TypeFormatterUtils.GetTypeColor(type, canBeModule: false));
            WriteTokenComment(type.MetadataToken);
        }