Esempio n. 1
0
        public EnumOrFlagsDefinition(PdlFile pdlFile, Boolean isFlagsDefinition, NamedObjectDefinition objectDefinedIn,
                                     PdlType underlyingIntegerType, String typeName)
        {
            this.isFlagsDefinition = isFlagsDefinition;
            this.isGlobalType      = (objectDefinedIn == null);

            this.underlyingIntegerType = underlyingIntegerType;
            this.byteCount             = underlyingIntegerType.IntegerTypeByteCount();

            this.typeName = typeName;
            this.typeNameLowerInvariantCase        = typeName.ToLowerInvariant();
            this.globalReferenceNameLowerInvariant = (objectDefinedIn == null) ? typeNameLowerInvariantCase :
                                                     (objectDefinedIn.globalReferenceNameLowerInvariant + "." + typeNameLowerInvariantCase);

            //
            // Add the definition to the static flags or enum definitions list
            //
            if (isFlagsDefinition)
            {
                enumValues = null;
                flagValues = new List <FlagsValueDefinition>();
            }
            else
            {
                enumValues = new List <EnumValueDefinition>();
                flagValues = null;
            }

            //
            // Add the defintion to the object and the pdl file
            //
            if (objectDefinedIn != null)
            {
                objectDefinedIn.AddEnumOrFlagDefinition(this);
            }
            pdlFile.AddEnumOrFlagsDefinition(this);
        }
Esempio n. 2
0
 public IntegerTypeReference(PdlType integerType, PdlArrayType arrayType)
     : base(integerType.ToString(), integerType, arrayType)
 {
     this.byteCount = integerType.IntegerTypeByteCount();
 }