Esempio n. 1
0
 public static void EmitType(this ILGeneratorInterface gen, Type t, bool assemblyQualified = true)
 {
     if (assemblyQualified)
     {
         gen.Emit(OpCodes.Ldstr, t.AssemblyQualifiedName);
         gen.Emit(OpCodes.Call,
                  (typeof(Type)).GetMethod("GetType", BindingFlags.Static | BindingFlags.Public, null,
                                           new[] { typeof(string) }, null));
     }
     else
     {
         gen.Emit(OpCodes.Ldtoken, t);
         gen.Emit(OpCodes.Call, typeof(Type).GetMethod("GetTypeFromHandle", new Type[1] {
             typeof(RuntimeTypeHandle)
         }));
     }
 }
Esempio n. 2
0
 public DebuggableILGenerator(ILGenerator generator, ISymbolDocumentWriter writer, string sourcePath)
 {
     _implementation = (ILGeneratorInterface) new implProxy(generator, writer, sourcePath).GetTransparentProxy();
 }