public static void Dispatch <T>(this Action <T> action, T arg, Dispatcher dispatcher) { if (dispatcher.CheckAccess()) { action(arg); } else { dispatcher.BeginInvoke(() => action(arg)); } }
public static void Dispatch <T1, T2, T3>(this Action <T1, T2, T3> action, T1 arg1, T2 arg2, T3 arg3, Dispatcher dispatcher) { if (dispatcher.CheckAccess()) { action(arg1, arg2, arg3); } else { dispatcher.BeginInvoke(() => action(arg1, arg2, arg3)); } }
public static void Dispatch(this Action action, Dispatcher dispatcher) { if (dispatcher.CheckAccess()) { action(); } else { dispatcher.BeginInvoke(() => action()); } }