Example #1
0
        protected static void RegisterGlobalKeyBindings()
        {
            IInputManager inputManager = ServiceRegistration.Get <IInputManager>();

            inputManager.AddKeyBinding(Key.Escape, () =>
            {
                // Close dialog or switch to previous workflow state
                IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();
                if (screenManager.IsDialogVisible)
                {
                    screenManager.CloseTopmostDialog();
                }
                else
                {
                    ServiceRegistration.Get <IWorkflowManager>().NavigatePop(1);
                }
            });
            inputManager.AddKeyBinding(Key.Fullscreen, () =>
            {
                //switch to fullscreen
                IScreenControl sc  = ServiceRegistration.Get <IScreenControl>();
                int nextMode       = ((int)sc.CurrentScreenMode) + 1;
                int totalModes     = Enum.GetNames(typeof(ScreenMode)).Length;
                ScreenMode newMode = (ScreenMode)(nextMode % totalModes);
                ServiceRegistration.Get <ILogger>().Info("SkinEngine: Switching screen mode from current '{0}' to '{1}'", sc.CurrentScreenMode, newMode);
                sc.SwitchMode(newMode);
            });
        }
Example #2
0
        public override void Save()
        {
            IScreenControl sc = ServiceRegistration.Get <IScreenControl>();

            // The called methods will change the entry in the setting
            sc.SwitchMode(_yes ? ScreenMode.FullScreen : ScreenMode.NormalWindowed);
        }
Example #3
0
        protected static void RegisterGlobalKeyBindings()
        {
            IInputManager inputManager = ServiceRegistration.Get <IInputManager>();

            inputManager.AddKeyBinding(Key.Escape, () =>
            {
                // Close dialog or switch to previous workflow state
                IScreenManager screenManager = ServiceRegistration.Get <IScreenManager>();
                if (screenManager.IsDialogVisible)
                {
                    screenManager.CloseTopmostDialog();
                }
                else
                {
                    ServiceRegistration.Get <IWorkflowManager>().NavigatePop(1);
                }
            });
            inputManager.AddKeyBinding(Key.Fullscreen, () =>
            {
                //switch to fullscreen
                IScreenControl sc = ServiceRegistration.Get <IScreenControl>();
                sc.SwitchMode(sc.IsFullScreen ? ScreenMode.NormalWindowed : ScreenMode.FullScreen);
            });
        }
        protected void SetScreenMode(ScreenMode mode)
        {
            IScreenControl sc = ServiceRegistration.Get <IScreenControl>();

            sc.SwitchMode(mode);
        }