public IDisposable Schedule(Action action) { var d = new BooleanDisposable(); MainThreadDispatcher.Post(scheduleAction, Tuple.Create(d, action)); return(d); }
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)); } }
public void ScheduleQueueing <T>(ICancelable cancel, T state, Action <T> action) { MainThreadDispatcher.Post(QueuedAction <T> .Instance, Tuple.Create(cancel, state, action)); }