Beispiel #1
0
 public static Delegate MakeVoidCall <T1, T2>(Delegate d)
 {
     return(new Action <T1, T2>((a1, a2) => {
         d.DynamicInvoke(new object[] { a1, a2 });
         NativeException.CheckNativeException();
     }));
 }
Beispiel #2
0
 public static Delegate MakeVoidCall(Delegate d)
 {
     return(new Action(() => {
         d.DynamicInvoke(null);
         NativeException.CheckNativeException();
     }));
 }
Beispiel #3
0
 public static Delegate MakeVoidCall <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Delegate d)
 {
     return(new Action <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>((a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16) =>
     {
         d.DynamicInvoke(new object[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16 });
         NativeException.CheckNativeException();
     }));
 }
Beispiel #4
0
 public static Delegate MakeVoidCall <T1, T2, T3, T4, T5, T6, T7, T8>(Delegate d)
 {
     return(new Action <T1, T2, T3, T4, T5, T6, T7, T8>((a1, a2, a3, a4, a5, a6, a7, a8) =>
     {
         d.DynamicInvoke(new object[] { a1, a2, a3, a4, a5, a6, a7, a8 });
         NativeException.CheckNativeException();
     }));
 }
Beispiel #5
0
 public static Delegate MakeCall <T1, T2, R>(Delegate d)
 {
     return(new Func <T1, T2, R>((a1, a2) => {
         R res = (R)d.DynamicInvoke(new object[] { a1, a2 });
         NativeException.CheckNativeException();
         return res;
     }));
 }
Beispiel #6
0
 public static Delegate MakeCall <R>(Delegate d)
 {
     return(new Func <R>(() => {
         R res = (R)d.DynamicInvoke(null);
         NativeException.CheckNativeException();
         return res;
     }));
 }
Beispiel #7
0
 public static Delegate MakeVoidCall <T1, T2, T3, T4, T5>(Delegate d)
 {
     return(new CrtAction <T1, T2, T3, T4, T5>((a1, a2, a3, a4, a5) =>
     {
         d.DynamicInvoke(new object[] { a1, a2, a3, a4, a5 });
         NativeException.CheckNativeException();
     }));
 }
Beispiel #8
0
 public static Delegate MakeCall <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R>(Delegate d)
 {
     return(new Func <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, R>((a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) =>
     {
         R res = (R)d.DynamicInvoke(new object[] { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 });
         NativeException.CheckNativeException();
         return res;
     }));
 }
Beispiel #9
0
 public static Delegate MakeCall <T1, T2, T3, T4, T5, T6, T7, R>(Delegate d)
 {
     return(new Func <T1, T2, T3, T4, T5, T6, T7, R>((a1, a2, a3, a4, a5, a6, a7) =>
     {
         R res = (R)d.DynamicInvoke(new object[] { a1, a2, a3, a4, a5, a6, a7 });
         NativeException.CheckNativeException();
         return res;
     }));
 }