예제 #1
0
        public static void RestartApp()
        {
            try
            {
                var _rep = App.Repository;
                MainWnd = new MainWindow();
                if (MonitorManager.IsTwoMonitor)
                {
                    LockDisplayWindow = new LockScreenWindow();
                }
                else
                {
                    MessageBox.Show("Пожалуйста подключите второй монитор или окулус");
                    return;
                }

                if (_rep.Setting.FirstOrDefault() == null)
                {
                    _rep.FirstExecute();
                }
                else
                {
                    Setting.Import();
                }


                if (App.Setting.IsKioskMode)
                {
                    Taskbar.Hide();
                    MainWnd.Topmost = true;
                }
                else
                {
                    MainWnd.Topmost = false;
                }

                if (MonitorManager.IsTwoMonitor)
                {
                    LockDisplayWindow.Show();
                }
                MainWnd.Show();
                MonitorManager meneger = new MonitorManager();

                if (MonitorManager.IsTwoMonitor)
                {
                    MonitorManager.RestartPositionWindows();
                }
            }
            catch (Exception ex)
            {
                MainWnd.Show();
                App.Frame.Navigate(new MainSettingPage(true));
            }
        }
예제 #2
0
        private static void ScreenManagerInit()
        {
            MainWnd = new MainWindow();

            if (ScreenManager.Singleton().Has2Screens)
            {
                LockDisplayWindow = new LockScreenWindow();
                ScreenManager.Singleton().NewWindow(MainWnd, WindowScreenStatus.Secondary);
                ScreenManager.Singleton().NewWindow(LockDisplayWindow, WindowScreenStatus.Primary);
            }
            else
            {
                MessageBox.Show("Пожалуйста подключите второй монитор или окулус");
                return;
            }
        }
예제 #3
0
        public void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                log4net.Config.XmlConfigurator.Configure();

                Logger.Info("Start seanse in VrManager!!!!!");
                var a = App.Repository.Setting;
            }
            catch (Exception ex)
            {
                App.Logger.Error($"exeption {ex.Message} (Пожалуста установите Microsoft SQL Server Compact 4.0) ||| in class {nameof(App)} and method {GetStackTraseMethod().GetMethod().Name}");
                MessageBox.Show("Пожалуста установите Microsoft SQL Server Compact 4.0");
                return;
            }
            try
            {
                MainWnd = new VrManager.MainWindow();
                MainWnd.Show();
                var _rep = App.Repository;
                if (MonitorManager.IsTwoMonitor)
                {
                    LockDisplayWindow = new LockScreenWindow();
                }

                if (_rep.Setting.FirstOrDefault() == null)
                {
                    _rep.FirstExecute();
                }
                else
                {
                    Setting.Import();
                }

                ObserverUserActivity.StartActivityObserv();

                if (App.Setting.IsKioskMode)
                {
                    Taskbar.Hide();
                    MainWnd.Topmost = true;
                }
                else
                {
                    MainWnd.Topmost = false;
                }

                if (MonitorManager.IsTwoMonitor)
                {
                    LockDisplayWindow.Show();
                }
                MainWnd.Show();

                MonitorManager.RestartPositionWindows();
            }
            catch (Exception ex)
            {
                try
                {
                    MainWnd.Show();
                }
                catch
                {
                    MessageBox.Show("Подключите оккулус или второй монитор");
                }
                App.Frame.Navigate(new MainSettingPage(true));
            }
        }