コード例 #1
0
ファイル: NuGenParameter.cs プロジェクト: carlhuth/GenXSource
 public void ReadMarshalInformation(NuGenIMetaDataImport2 import, Dictionary <uint, NuGenTokenBase> allTokens, int parameterCount)
 {
     if ((AttributeFlags & CorParamAttr.pdHasFieldMarshal) == CorParamAttr.pdHasFieldMarshal)
     {
         MarshalAsTypeString = string.Format("marshal({0})", NuGenHelperFunctions.ReadMarshalDescriptor(import, allTokens, Token, parameterCount));
     }
 }
コード例 #2
0
        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();
            }
        }