Inheritance: TargetEnumType
Example #1
0
        public MonoEnumInfo(MonoEnumType type, TargetType field_type, int index, int pos,
				     Cecil.FieldDefinition finfo)
            : base(field_type, finfo.Name, index, finfo.IsStatic,
				MonoFieldInfo.GetAccessibility (finfo),
				pos, 0, finfo.HasConstant)
        {
            FieldInfo = finfo;
        }
Example #2
0
        public TargetType LookupMonoType(Cecil.TypeReference type)
        {
            TargetType result = (TargetType) type_hash [type];
            if (result != null)
                return result;

            if (type is Cecil.ArrayType) {
                Cecil.ArrayType atype = (Cecil.ArrayType) type;
                TargetType element_type = LookupMonoType (atype.ElementType);
                result = new MonoArrayType (element_type, atype.Rank);
            } else if (type is Cecil.TypeDefinition) {
                Cecil.TypeDefinition tdef = (Cecil.TypeDefinition) type;
                if (tdef.IsEnum)
                    result = new MonoEnumType (this, tdef);
                else
                    result = new MonoClassType (this, tdef);
            } else {
                Console.WriteLine ("UNKNOWN TYPE: {0} {1}", type, type.GetType ());
                return null;
            }

            if (!type_hash.Contains (type))
                type_hash.Add (type, result);
            return result;
        }