Esempio n. 1
0
 public static Action <T0, T1, T2, T3> ToEngineType <T0, T1, T2, T3>(this TestityEvent <T0, T1, T2, T3> e)
 {
     //if the event is not null and has actual listeners
     if (e != null && e.GetPersistentEventCount() != 0)
     {
         return(new Action <T0, T1, T2, T3>((arg0, arg1, arg2, arg3) => e.Invoke(arg0, arg1, arg2, arg3)));
     }
     else
     {
         return(null);            //a null action works better than invoking the slow and empty TestityEvent
     }
 }
Esempio n. 2
0
 public static Action ToEngineType(this TestityEvent e)
 {
     //if the event is not null and has actual listeners
     if (e != null && e.GetPersistentEventCount() != 0)
     {
         return(new Action(() => e.Invoke()));
     }
     else
     {
         return(null);            //a null action works better than invoking the slow and empty TestityEvent
     }
 }