Пример #1
0
 public static ModuleDefinition CreateModule(string name, ModuleKind kind)
 {
     return(ModuleDefinition.CreateModule(name, new ModuleParameters
     {
         Kind = kind
     }));
 }
Пример #2
0
        public static AssemblyDefinition CreateAssembly(AssemblyNameDefinition assemblyName, string moduleName, ModuleParameters parameters)
        {
            if (assemblyName == null)
            {
                throw new ArgumentNullException("assemblyName");
            }
            if (moduleName == null)
            {
                throw new ArgumentNullException("moduleName");
            }
            Mixin.CheckParameters(parameters);
            if (parameters.Kind == ModuleKind.NetModule)
            {
                throw new ArgumentException("kind");
            }
            AssemblyDefinition assembly = ModuleDefinition.CreateModule(moduleName, parameters).Assembly;

            assembly.Name = assemblyName;
            return(assembly);
        }