// Constructor. internal ModuleBuilder(AssemblyBuilder assembly, String name, bool transient, bool emitSymbolInfo) { // Initialize the fields within this object. this.assembly = assembly; this.name = name; this.transient = transient; this.emitSymbolInfo = emitSymbolInfo; // Register this object for detaching. assembly.AddDetach(this); // Create a new module within the assembly. lock (typeof(AssemblyBuilder)) { privateData = ClrModuleCreate(assembly.privateData, name); } // Create the module type for this module. moduleType = new TypeBuilder(this, "<Module>", null, TypeAttributes.NotPublic, null, null, PackingSize.Unspecified, 0, null); moduleType.needsDefaultConstructor = false; }
// Constructor. internal ModuleBuilder(AssemblyBuilder assembly, String name, bool transient, bool emitSymbolInfo) { // Initialize the fields within this object. this.assembly = assembly; this.name = name; this.transient = transient; this.emitSymbolInfo = emitSymbolInfo; // Register this object for detaching. assembly.AddDetach(this); // Create a new module within the assembly. lock(typeof(AssemblyBuilder)) { privateData = ClrModuleCreate(assembly.privateData, name); } // Create the module type for this module. moduleType = new TypeBuilder(this, "<Module>", null, TypeAttributes.NotPublic, null, null, PackingSize.Unspecified, 0, null); moduleType.needsDefaultConstructor = false; }