Exemplo n.º 1
0
 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));
     }
 }
Exemplo n.º 2
0
 public static void Dispatch(this Action action, Dispatcher dispatcher)
 {
     if (dispatcher.CheckAccess())
     {
         action();
     }
     else
     {
         dispatcher.BeginInvoke(() => action());
     }
 }
Exemplo n.º 3
0
 public static void Dispatch <T>(this Action <T> action, T arg, Dispatcher dispatcher)
 {
     if (dispatcher.CheckAccess())
     {
         action(arg);
     }
     else
     {
         dispatcher.BeginInvoke(() => action(arg));
     }
 }
Exemplo n.º 4
-14
        public async static Task InvokeOnUI(CoreDispatcher d, Action a)
#endif
        {
#if WINDOWS_PHONE 
            d.BeginInvoke(a);
            await Task.Delay(0);
#elif !NETFX_CORE
            await d.BeginInvoke(a);
#else
            await d.RunAsync(CoreDispatcherPriority.Normal, new DispatchedHandler(a));
#endif
        }