Esempio n. 1
0
            public IDisposable Schedule(Action action)
            {
                var d = new BooleanDisposable();

                MainThreadDispatcher.Post(scheduleAction, Tuple.Create(d, action));
                return(d);
            }
Esempio n. 2
0
 public override void Post(SendOrPostCallback d, object state)
 {
     // If is in mainthread, call direct.
     if (MainThreadDispatcher.IsInMainThread)
     {
         d(state);
     }
     else
     {
         MainThreadDispatcher.Post(x =>
         {
             var pair = (Pair)x;
             pair.Callback(pair.State);
         }, new Pair(d, state));
     }
 }
Esempio n. 3
0
 public void ScheduleQueueing <T>(ICancelable cancel, T state, Action <T> action)
 {
     MainThreadDispatcher.Post(QueuedAction <T> .Instance, Tuple.Create(cancel, state, action));
 }