private void WriteCustomAttributeEnumValue(TypeReference enum_type, object value) { TypeDefinition self = enum_type.CheckedResolve(); if (!self.IsEnum) { throw new ArgumentException(); } this.WriteCustomAttributeValue(self.GetEnumUnderlyingType(), value); }
private object ReadCustomAttributeEnum(TypeReference enum_type) { TypeDefinition typeDefinition = enum_type.CheckedResolve(); if (!typeDefinition.IsEnum) { throw new ArgumentException(); } return(this.ReadCustomAttributeElementValue(typeDefinition.GetEnumUnderlyingType())); }