Widow
/trunk/Widow/Utilities.cs |
---|
@@ -35,17 +35,16 @@ |
return true; |
} |
public static void Execute(this Control control, Action lambda) |
public static void InvokeIfRequired<T>(this T control, Action<T> action) where T : Control |
{ |
if (control.InvokeRequired) |
{ |
control.Invoke((MethodInvoker) lambda.Invoke); |
control.BeginInvoke((MethodInvoker) delegate { action(control); }); |
return; |
} |
else |
{ |
lambda.Invoke(); |
action(control); |
} |
} |
public static bool Set(bool enable) |
{ |