Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Invoke(this Dispatcher dispatcher, Action action)
- {
- dispatcher.Invoke(action, null);
- }
- public static void Invoke<T>(this Dispatcher dispatcher, Action<T> action, T param)
- {
- dispatcher.Invoke(action, param);
- }
- public static T Invoke<T>(this Dispatcher dispatcher, Func<T> func)
- where T : class
- {
- return dispatcher.Invoke(func, null) as T;
- }
- public static void BeginInvoke(this Dispatcher dispatcher, Action action)
- {
- dispatcher.BeginInvoke(action, null);
- }
- public static void BeginInvoke<T>(this Dispatcher dispatcher, Action<T> action, T param)
- {
- dispatcher.BeginInvoke(action, param);
- }
- public static void BeginInvoke<T>(this Dispatcher dispatcher, Func<T> func, Action<T> closure)
- where T : class
- {
- var dop = dispatcher.BeginInvoke(func, null);
- dop.Completed += (o, e) => closure(dop.Result as T);
- }
Add Comment
Please, Sign In to add comment