Пример #1
0
 internal void GenerateCall(MethodStructure method)
 {
     var m = method.GainMethod();
     if (m.IsVirtual)
     {
         Generator.Emit(OpCodes.Callvirt, m);
     }
     else
     {
         Generator.Emit(OpCodes.Call, m);
     }
 }
Пример #2
0
 internal MethodInfo RenewMethod(MethodStructure method)
 {
     if (Info.GetType().Name == "TypeBuilderInstantiation")
     {
         return TypeBuilder.GetMethod(Info, method.GainMethod());
     }
     else
     {
         var m = method.GainMethod();
         var types = Info.RenewTypes(m.GetParameters().ToTypes());
         var ret = Info.GetMethod(m.Name, types);
         if (ret == null)
         {
             throw new InvalidOperationException();
         }
         return ret;
     }
 }