本文整理汇总了C#中System.Reflection.Emit.AssemblyBuilder.GetModules方法的典型用法代码示例。如果您正苦于以下问题:C# AssemblyBuilder.GetModules方法的具体用法?C# AssemblyBuilder.GetModules怎么用?C# AssemblyBuilder.GetModules使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.AssemblyBuilder
的用法示例。
在下文中一共展示了AssemblyBuilder.GetModules方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DynamicAssemblyManager
static DynamicAssemblyManager()
{
#if !SILVERLIGHT
assemblyName = new AssemblyName("NLiteDynamicAssembly");
assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(
assemblyName,
AssemblyBuilderAccess.RunAndSave
);
moduleBuilder = assemblyBuilder.DefineDynamicModule(
assemblyName.Name,
assemblyName.Name + ".dll",
true);
Module = assemblyBuilder.GetModules().FirstOrDefault();
#else
assemblyName = new AssemblyName("EmitMapperAssembly.SL");
assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(
assemblyName,
AssemblyBuilderAccess.Run
);
moduleBuilder = assemblyBuilder.DefineDynamicModule(assemblyName.Name, true);
#endif
}
示例2: DynamicAssemblyManager
static DynamicAssemblyManager()
{
assemblyName = new AssemblyName("EagleDynamicAssembly");
assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(
assemblyName,
AssemblyBuilderAccess.RunAndSave
);
moduleBuilder = assemblyBuilder.DefineDynamicModule(
assemblyName.Name,
assemblyName.Name + ".dll",
true);
Module = assemblyBuilder.GetModules().FirstOrDefault();
}
示例3: ManifestModule
public void ManifestModule ()
{
AssemblyName aname = new AssemblyName ("ManifestModule1");
ab = domain.DefineDynamicAssembly (aname, AssemblyBuilderAccess.RunAndSave,
tempDir);
Assert.IsNotNull (ab.ManifestModule, "#A1");
Assert.AreEqual (1, ab.GetModules ().Length, "#A2");
Assert.AreEqual (typeof (ModuleBuilder), ab.ManifestModule.GetType (), "#A3");
ModuleBuilder mb1 = (ModuleBuilder) ab.ManifestModule;
Assert.AreSame (mb1, ab.GetModules () [0], "#B1");
Assert.IsFalse (mb1.IsResource (), "#B2");
Assert.AreSame (mb1, ab.ManifestModule, "#B3");
ab.Save ("ManifestModule.dll");
ModuleBuilder mb2 = (ModuleBuilder) ab.ManifestModule;
Assert.AreSame (mb2, ab.GetModules () [0], "#C1");
Assert.IsFalse (mb2.IsResource (), "#C2");
Assert.AreSame (mb2, ab.ManifestModule, "#C3");
Assert.AreSame (mb1, mb2, "#C4");
}