Пример #1
0
        private void WriteCustomAttributeEnumValue(TypeReference enum_type, object value)
        {
            TypeDefinition self = enum_type.CheckedResolve();

            if (!self.IsEnum)
            {
                throw new ArgumentException();
            }
            this.WriteCustomAttributeValue(self.GetEnumUnderlyingType(), value);
        }
Пример #2
0
        private object ReadCustomAttributeEnum(TypeReference enum_type)
        {
            TypeDefinition typeDefinition = enum_type.CheckedResolve();

            if (!typeDefinition.IsEnum)
            {
                throw new ArgumentException();
            }
            return(this.ReadCustomAttributeElementValue(typeDefinition.GetEnumUnderlyingType()));
        }