コード例 #1
0
 public CoreDispatcherPriorityScheduler(CoreDispatcher dispatcher)
 {
     _lowScheduler    = new CoreDispatcherScheduler(dispatcher, CoreDispatcherPriority.Low);
     _normalScheduler = new CoreDispatcherScheduler(dispatcher, CoreDispatcherPriority.Normal);
     _highScheduler   = new CoreDispatcherScheduler(dispatcher, CoreDispatcherPriority.High);
     _lowestScheduler = new CoreDispatcherScheduler(dispatcher, CoreDispatcherPriority.Idle);
 }
コード例 #2
0
ファイル: WinRTSchedulers.cs プロジェクト: Galad/Hanno
		public WinRtSchedulers(CoreDispatcherScheduler coreDispatcher, IPriorityScheduler dispatcher, IPriorityScheduler threadPool)
		{
			if (coreDispatcher == null) throw new ArgumentNullException("coreDispatcher");
			if (dispatcher == null) throw new ArgumentNullException("dispatcher");
			if (threadPool == null) throw new ArgumentNullException("threadPool");
			_coreDispatcher = coreDispatcher;
			_dispatcher = dispatcher;
			_threadPool = threadPool;
		}
コード例 #3
0
ファイル: WinRTSchedulers.cs プロジェクト: Galad/Hanno
 public WinRtSchedulers(CoreDispatcherScheduler coreDispatcher, IPriorityScheduler dispatcher, IPriorityScheduler threadPool)
 {
     if (coreDispatcher == null)
     {
         throw new ArgumentNullException("coreDispatcher");
     }
     if (dispatcher == null)
     {
         throw new ArgumentNullException("dispatcher");
     }
     if (threadPool == null)
     {
         throw new ArgumentNullException("threadPool");
     }
     _coreDispatcher = coreDispatcher;
     _dispatcher     = dispatcher;
     _threadPool     = threadPool;
 }
コード例 #4
0
ファイル: WinRTModule.cs プロジェクト: Galad/Hanno
 public WinRtModule(Frame frame, CoreDispatcherScheduler dispatcher)
 {
     _frame      = frame;
     _dispatcher = dispatcher;
 }
コード例 #5
0
        private async Task <PlayerViewManager> GetEnsureSecondaryView()
        {
            if (IsMainView && SecondaryCoreAppView == null)
            {
                var playerView = CoreApplication.CreateNewView();


                HohoemaSecondaryViewFrameViewModel vm = null;
                int                id   = 0;
                ApplicationView    view = null;
                INavigationService ns   = null;
                await playerView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
                {
                    // SecondaryViewのスケジューラをセットアップ
                    SecondaryViewScheduler = new CoreDispatcherScheduler(playerView.Dispatcher);

                    playerView.TitleBar.ExtendViewIntoTitleBar = true;

                    var content = new Views.HohoemaSecondaryViewFrame();

                    var frameFacade = new FrameFacadeAdapter(content.Frame, EventAggregator);

                    var sessionStateService = new SessionStateService();

                    //sessionStateService.RegisterFrame(frameFacade, "secondary_view_player");
                    ns = new FrameNavigationService(frameFacade
                                                    , (pageToken) =>
                    {
                        if (pageToken == nameof(Views.VideoPlayerPage))
                        {
                            return(typeof(Views.VideoPlayerPage));
                        }
                        else if (pageToken == nameof(Views.LivePlayerPage))
                        {
                            return(typeof(Views.LivePlayerPage));
                        }
                        else
                        {
                            return(typeof(Views.BlankPage));
                        }
                    }, sessionStateService);

                    vm = content.DataContext as HohoemaSecondaryViewFrameViewModel;

                    Window.Current.Content = content;

                    id = ApplicationView.GetApplicationViewIdForWindow(playerView.CoreWindow);

                    view = ApplicationView.GetForCurrentView();

                    view.TitleBar.ButtonBackgroundColor         = Windows.UI.Colors.Transparent;
                    view.TitleBar.ButtonInactiveBackgroundColor = Windows.UI.Colors.Transparent;

                    Window.Current.Activate();

                    await ApplicationViewSwitcher.TryShowAsStandaloneAsync(id, ViewSizePreference.UseHalf, MainViewId, ViewSizePreference.UseHalf);

                    // ウィンドウサイズの保存と復元
                    if (Services.Helpers.DeviceTypeHelper.IsDesktop)
                    {
                        var localObjectStorageHelper = App.Current.Container.Resolve <Microsoft.Toolkit.Uwp.Helpers.LocalObjectStorageHelper>();
                        if (localObjectStorageHelper.KeyExists(secondary_view_size))
                        {
                            view.TryResizeView(localObjectStorageHelper.Read <Size>(secondary_view_size));
                        }

                        view.VisibleBoundsChanged += View_VisibleBoundsChanged;
                    }

                    view.Consolidated += SecondaryAppView_Consolidated;
                });

                SecondaryAppView     = view;
                _SecondaryViewVM     = vm;
                SecondaryCoreAppView = playerView;
                SecondaryViewPlayerNavigationService = ns;

                App.Current.Container.RegisterInstance(SECONDARY_VIEW_PLAYER_NAVIGATION_SERVICE, SecondaryViewPlayerNavigationService);
            }

            return(this);
        }
コード例 #6
0
 public ConcurrencyService()
 {
     _dispatcherScheduler = new CoreDispatcherScheduler(CoreApplication.MainView.CoreWindow.Dispatcher);
 }
コード例 #7
0
 public ConcurrencyService()
 {
     _dispatcherScheduler = new CoreDispatcherScheduler(CoreApplication.MainView.CoreWindow.Dispatcher);
     _scheduler           = new PeriodicBatchScheduler(_dispatcherScheduler);
 }
コード例 #8
0
ファイル: WinRTModule.cs プロジェクト: Galad/Hanno
		public WinRtModule(Frame frame, CoreDispatcherScheduler dispatcher)
		{
			_frame = frame;
			_dispatcher = dispatcher;
		}
 public XamarinDispatcherScheduler(CoreDispatcherScheduler dispatchScheduler) =>
コード例 #10
0
 static partial void OverrideDispatchScheduler(ref IScheduler scheduler)
 {
     scheduler = new CoreDispatcherScheduler(Window.Current.Dispatcher);
 }