示例#1
0
        internal AssemblyMetadata(ModuleMetadata manifestModule, Func <string, ModuleMetadata> moduleFactory)
            : base(isImageOwner: true, id: MetadataId.CreateNewId())
        {
            Debug.Assert(manifestModule != null);
            Debug.Assert(moduleFactory != null);

            _initialModules   = ImmutableArray.Create(manifestModule);
            _moduleFactoryOpt = moduleFactory;
        }
示例#2
0
        private ModuleMetadata(PEReader peReader, IDisposable?owner, bool disposeOwner)
            : base(isImageOwner: true, id: MetadataId.CreateNewId())
        {
            // If we've been asked to dispose the owner, then we better have an owner to dispose.
            Debug.Assert(!disposeOwner || owner is not null);

            _module       = new PEModule(this, peReader: peReader, metadataOpt: IntPtr.Zero, metadataSizeOpt: 0, includeEmbeddedInteropTypes: false, ignoreAssemblyRefs: false);
            _owner        = owner;
            _disposeOwner = disposeOwner;
        }
示例#3
0
 private ModuleMetadata(
     IntPtr metadata,
     int size,
     Action?onDispose,
     bool includeEmbeddedInteropTypes,
     bool ignoreAssemblyRefs)
     : base(isImageOwner: true, id: MetadataId.CreateNewId())
 {
     _module    = new PEModule(this, peReader: null, metadataOpt: metadata, metadataSizeOpt: size, includeEmbeddedInteropTypes: includeEmbeddedInteropTypes, ignoreAssemblyRefs: ignoreAssemblyRefs);
     _onDispose = onDispose;
 }
示例#4
0
 private ModuleMetadata(PEReader peReader)
     : base(isImageOwner: true, id: MetadataId.CreateNewId())
 {
     _module = new PEModule(
         this,
         peReader: peReader,
         metadataOpt: IntPtr.Zero,
         metadataSizeOpt: 0,
         includeEmbeddedInteropTypes: false,
         ignoreAssemblyRefs: false
         );
 }
示例#5
0
 private ModuleMetadata(IntPtr metadata, int size, bool includeEmbeddedInteropTypes)
     : base(isImageOwner: true, id: MetadataId.CreateNewId())
 {
     _module = new PEModule(this, peReader: null, metadataOpt: metadata, metadataSizeOpt: size, includeEmbeddedInteropTypes: includeEmbeddedInteropTypes);
 }
示例#6
0
 private ModuleMetadata(PEReader peReader)
     : base(isImageOwner: true, id: MetadataId.CreateNewId())
 {
     _module = new PEModule(this, peReader: peReader, metadataOpt: IntPtr.Zero, metadataSizeOpt: 0);
 }
示例#7
0
 internal AssemblyMetadata(ImmutableArray <ModuleMetadata> modules)
     : base(isImageOwner: true, id: MetadataId.CreateNewId())
 {
     Debug.Assert(!modules.IsDefaultOrEmpty);
     _initialModules = modules;
 }