Assert that we're on the right scheduler

This commit is contained in:
Haacked 2015-03-13 14:58:12 -07:00
Родитель 0e39681007
Коммит 8b304e29c8
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -1,9 +1,11 @@
using System;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Windows;
using System.Windows.Controls;
using GitHub.Authentication;
using GitHub.Exports;
@ -35,6 +37,13 @@ namespace GitHub.Controllers
this.factory = factory;
this.uiProvider = uiProvider;
#if DEBUG
if (Application.Current != null && !Splat.ModeDetector.InUnitTestRunner())
{
Debug.Assert(((DispatcherScheduler)RxApp.MainThreadScheduler).Dispatcher == Application.Current.Dispatcher,
"The MainThreadScheduler is using the wrong dispatcher");
}
#endif
machine = new StateMachine<UIViewType, Trigger>(UIViewType.None);
machine.Configure(UIViewType.None)