本文整理汇总了C#中System.Reflection.Emit.ModuleBuilder.GetTypes方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleBuilder.GetTypes方法的具体用法?C# ModuleBuilder.GetTypes怎么用?C# ModuleBuilder.GetTypes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.ModuleBuilder
的用法示例。
在下文中一共展示了ModuleBuilder.GetTypes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateComTypesInAssembly
private static void UpdateComTypesInAssembly(AssemblyBuilder asmBldr, ModuleBuilder modBldr)
{
AssemblyBuilderData assemblyData = asmBldr.m_assemblyData;
Type[] types = modBldr.GetTypes();
int length = types.Length;
for (int i = 0; i < length; i++)
{
assemblyData.AddPublicComType(types[i]);
}
}
示例2: UpdateComTypesInAssembly
private static void UpdateComTypesInAssembly(AssemblyBuilder asmBldr, ModuleBuilder modBldr)
{
// Retrieve the AssemblyBuilderData associated with the assembly builder.
AssemblyBuilderData AsmBldrData = asmBldr.m_assemblyData;
// Go through the types in the module and add them as public COM types.
Type[] aTypes = modBldr.GetTypes();
int NumTypes = aTypes.Length;
for (int cTypes = 0; cTypes < NumTypes; cTypes++)
AsmBldrData.AddPublicComType(aTypes[cTypes]);
}
示例3: ModuleBuilder_GetType
// ...
// There's a bug in ModuleBuilder.GetType(), so we have to use our own
// version for now.
System.Type ModuleBuilder_GetType(ModuleBuilder m, string stType)
{
#if false
// This should work, but is broken for nested types.
return m.GetType(stType);
#else
// Here's our hack to use in the meantime
// Note, we have to deal with appended characters like [], and &
// This is a hack that will work for now. When reflection-emit fixes the
// bug, we can get rid of this.
Type [] al = m.GetTypes();
foreach(Type t in al)
{
if (t.FullName == stType)
return t;
}
return null;
#endif
}