コード例 #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_types.OnTypeDefinitionAdded += new TypeDefinitionEventHandler (OnTypeDefinitionAdded);
            m_types.OnTypeDefinitionRemoved += new TypeDefinitionEventHandler (OnTypeDefinitionRemoved);
            m_refs = new TypeReferenceCollection (this);
            m_refs.OnTypeReferenceAdded += new TypeReferenceEventHandler (OnTypeReferenceAdded);
            m_refs.OnTypeReferenceRemoved += new TypeReferenceEventHandler (OnTypeReferenceRemoved);
            m_members = new MemberReferenceCollection (this);

            m_controller = new ReflectionController (this);
        }
コード例 #2
0
        static AssemblyDefinition GetAssembly(ImageReader irv, bool manifestOnly)
        {
            StructureReader    srv = new StructureReader(irv, manifestOnly);
            AssemblyDefinition asm = new AssemblyDefinition(
                new AssemblyNameDefinition(), srv);

            asm.Accept(srv);
            return(asm);
        }
コード例 #3
0
		static AssemblyDefinition GetAssembly (ImageReader irv, bool manifestOnly)
		{
			StructureReader srv = new StructureReader (irv, manifestOnly);
			AssemblyDefinition asm = new AssemblyDefinition (
				new AssemblyNameDefinition (), srv);

			asm.Accept (srv);
			return asm;
		}
コード例 #4
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_types.OnTypeDefinitionAdded   += new TypeDefinitionEventHandler(OnTypeDefinitionAdded);
            m_types.OnTypeDefinitionRemoved += new TypeDefinitionEventHandler(OnTypeDefinitionRemoved);
            m_refs = new TypeReferenceCollection(this);
            m_refs.OnTypeReferenceAdded   += new TypeReferenceEventHandler(OnTypeReferenceAdded);
            m_refs.OnTypeReferenceRemoved += new TypeReferenceEventHandler(OnTypeReferenceRemoved);
            m_members = new MemberReferenceCollection(this);

            m_controller = new ReflectionController(this);
        }
コード例 #5
0
 internal AssemblyDefinition(AssemblyNameDefinition name, StructureReader reader) : this(name)
 {
     m_reader = reader;
 }
コード例 #6
0
ファイル: AssemblyDefinition.cs プロジェクト: NALSS/Telegraph
 internal AssemblyDefinition(AssemblyNameDefinition name, StructureReader reader)
     : this(name)
 {
     m_reader = reader;
 }
コード例 #7
0
 internal ModuleDefinition(string name, AssemblyDefinition asm, StructureReader reader) :
     this(name, asm, reader, false)
 {
 }
コード例 #8
0
 internal ModuleDefinition(string name, AssemblyDefinition asm, StructureReader reader)
     : this(name, asm, reader, false)
 {
 }