Example #1
0
        internal ModuleDefinition(string name, AssemblyDefinition asm, StructureReader reader, bool main) : base(name)
        {
            if (asm == null)
            {
                throw new ArgumentNullException("asm");
            }
            if (name == null || name.Length == 0)
            {
                throw new ArgumentNullException("name");
            }

            m_asm  = asm;
            m_main = main;
#if !CF_1_0
            m_mvid = Guid.NewGuid();
#endif
            if (reader != null)
            {
                m_image        = reader.Image;
                m_imgReader    = reader.ImageReader;
                m_manifestOnly = reader.ManifestOnly;
            }
            else
            {
                m_image = Image.CreateImage();
            }

            m_modRefs = new ModuleReferenceCollection(this);
            m_asmRefs = new AssemblyNameReferenceCollection(this);
            m_res     = new ResourceCollection(this);
            m_types   = new TypeDefinitionCollection(this);
            m_refs    = new TypeReferenceCollection(this);
            m_members = new MemberReferenceCollection(this);

            m_controller = new ReflectionController(this);
            m_resolver   = new MetadataResolver(asm);
        }
        public override void VisitTypeDefinitionCollection(TypeDefinitionCollection types)
        {
            base.VisitTypeDefinitionCollection(types);

            ReadGenericParameterConstraints();
            ReadClassLayoutInfos();
            ReadFieldLayoutInfos();
            ReadPInvokeInfos();
            ReadProperties();
            ReadEvents();
            ReadSemantics();
            ReadInterfaces();
            ReadOverrides();
            ReadSecurityDeclarations();
            ReadCustomAttributes();
            ReadConstants();
            ReadExternTypes();
            ReadMarshalSpecs();
            ReadInitialValues();

            m_events     = null;
            m_properties = null;
            m_parameters = null;
        }
Example #3
0
 public virtual void VisitTypeDefinitionCollection(TypeDefinitionCollection types)
 {
 }