protected override void ReadMetadataInformation() { base.ReadMetadataInformation(); NuGenAssembly assembly = BaseTypeDefinition.ModuleScope.Assembly; try { assembly.OpenMetadataInterfaces(); if ((Flags & CorFieldAttr.fdHasDefault) == CorFieldAttr.fdHasDefault) { object defaultValueNumber; DefaultValueAsString = NuGenHelperFunctions.ReadDefaultValue(DefaultValueType, DefaultValue, DefaultValueLength, out defaultValueNumber); DefaultValueNumber = defaultValueNumber; } if ((Flags & CorFieldAttr.fdHasFieldMarshal) == CorFieldAttr.fdHasFieldMarshal) { MarshalAsTypeString = string.Format("marshal({0})", NuGenHelperFunctions.ReadMarshalDescriptor(assembly.Import, BaseTypeDefinition.ModuleScope.Assembly.AllTokens, Token, 0)); } if ((Flags & CorFieldAttr.fdPinvokeImpl) == CorFieldAttr.fdPinvokeImpl) { PinvokeMap = NuGenHelperFunctions.ReadPinvokeMap(assembly.Import, BaseTypeDefinition.ModuleScope.Assembly, Token); } CustomAttributes = NuGenHelperFunctions.EnumCustomAttributes(assembly.Import, BaseTypeDefinition.ModuleScope.Assembly, this); } finally { assembly.CloseMetadataInterfaces(); } }