andrew4582

FormControlExtentions

Feb 23rd, 2011
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.11 KB | None | 0 0
  1.     public static class FormControlExtentions {
  2.         public static void BeginInvoke(this Control cnt,Action invokeAction) {
  3.             cnt.BeginInvoke(new Action(invokeAction));
  4.         }
  5.         public static void BeginInvoke<T>(this Control cnt,Action<T> invokeAction,T arg) {
  6.             cnt.BeginInvoke(new Action<T>(invokeAction),arg);
  7.         }
  8.         public static void BeginInvoke<T,T1>(this Control cnt,Action<T,T1> invokeAction,T arg,T1 arg1) {
  9.             cnt.BeginInvoke(new Action<T,T1>(invokeAction),arg,arg1);
  10.         }
  11.         public static void BeginInvoke<T,T1,T2>(this Control cnt,Action<T,T1,T2> invokeAction,T arg,T1 arg1,T2 arg2) {
  12.             cnt.BeginInvoke(new Action<T,T1,T2>(invokeAction),arg,arg1,arg2);
  13.         }
  14.         public static void BeginInvoke(this Control cnt,Action<object[]> invokeAction,params object[] args) {
  15.             cnt.BeginInvoke(new Action<object[]>(invokeAction),args);
  16.         }
  17.         public static void BeginInvoke<T>(this Control cnt,Action<T[]> invokeAction,params T[] args) {
  18.             cnt.BeginInvoke(new Action<T[]>(invokeAction),args);
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment