示例#1
0
 public override void VisitAssemblyNameReferenceCollection(AssemblyNameReferenceCollection references)
 {
     foreach (AssemblyNameReference name in references)
     {
         VisitAssemblyNameReference(name);
     }
 }
示例#2
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);
        }
示例#3
0
        public override void VisitAssemblyNameReferenceCollection(AssemblyNameReferenceCollection names)
        {
            if (!m_tHeap.HasTable(AssemblyRefTable.RId))
            {
                return;
            }

            AssemblyRefTable arTable = m_tableReader.GetAssemblyRefTable();

            for (int i = 0; i < arTable.Rows.Count; i++)
            {
                AssemblyRefRow        arRow = arTable [i];
                AssemblyNameReference aname = new AssemblyNameReference(
                    ReadString(arRow.Name),
                    ReadString(arRow.Culture),
                    new Version(arRow.MajorVersion, arRow.MinorVersion,
                                arRow.BuildNumber, arRow.RevisionNumber));
                aname.PublicKeyToken = ReadBlob(arRow.PublicKeyOrToken);
                aname.Hash           = ReadBlob(arRow.HashValue);
                aname.Flags          = arRow.Flags;
                aname.MetadataToken  = new MetadataToken(TokenType.AssemblyRef, (uint)i + 1);
                names.Add(aname);
            }
        }
 public virtual void VisitAssemblyNameReferenceCollection(AssemblyNameReferenceCollection names)
 {
 }