예제 #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// If the splash screen is showing, this will force it to be closed.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public static void ForceCloseOfSplashScreen()
 {
     if (s_splashScreen != null)
     {
         s_splashScreen.Close();
     }
 }
        internal void Terminate()
        {
            DeregisterEvents();

            if (SessionIsRunning)
            {
                StopSession();
            }

            logger.Unsubscribe(runtimeWindow);
            runtimeWindow.Close();

            splashScreen.Show();
            splashScreen.BringToForeground();

            logger.Log(string.Empty);
            logger.Info("Initiating shutdown procedure...");

            var success = bootstrapSequence.TryRevert() == OperationResult.Success;

            if (success)
            {
                logger.Info("Application successfully finalized.");
                logger.Log(string.Empty);
            }
            else
            {
                logger.Info("Shutdown procedure failed!");
                logger.Log(string.Empty);

                messageBox.Show(TextKey.MessageBox_ShutdownError, TextKey.MessageBox_ShutdownErrorTitle, icon: MessageBoxIcon.Error, parent: splashScreen);
            }

            splashScreen.Close();
        }
예제 #3
0
        internal void Terminate()
        {
            logger.Log(string.Empty);
            logger.Info("Initiating shutdown procedure...");

            splashScreen.Show();
            splashScreen.BringToForeground();

            CloseShell();
            DeregisterEvents();

            var success = operations.TryRevert() == OperationResult.Success;

            if (success)
            {
                logger.Info("Application successfully finalized.");
                logger.Log(string.Empty);
            }
            else
            {
                logger.Info("Shutdown procedure failed!");
                logger.Log(string.Empty);
            }

            splashScreen.Close();
        }
        public void Terminate()
        {
            logger.Log(string.Empty);
            logger.Info("Initiating shutdown procedure...");

            splashScreen = uiFactory.CreateSplashScreen(appConfig);
            actionCenter.Close();
            taskbar.Close();

            DeregisterEvents();

            var success = operations.TryRevert() == OperationResult.Success;

            if (success)
            {
                logger.Info("Application successfully finalized.");
                logger.Log(string.Empty);
            }
            else
            {
                logger.Info("Shutdown procedure failed!");
                logger.Log(string.Empty);
            }

            splashScreen.Close();
        }
예제 #5
0
        /// ------------------------------------------------------------------------------------
        public void CloseSplashScreen()
        {
            if (_splashScreen != null)
            {
                _splashScreen.Close();
            }

            _splashScreen = null;
        }
        private void ClientHost_PasswordRequested(PasswordRequestEventArgs args)
        {
            var message = default(TextKey);
            var title   = default(TextKey);

            logger.Info($"Received input request with id '{args.RequestId}' for the {args.Purpose.ToString().ToLower()} password.");

            switch (args.Purpose)
            {
            case PasswordRequestPurpose.LocalAdministrator:
                message = TextKey.PasswordDialog_LocalAdminPasswordRequired;
                title   = TextKey.PasswordDialog_LocalAdminPasswordRequiredTitle;
                break;

            case PasswordRequestPurpose.LocalSettings:
                message = TextKey.PasswordDialog_LocalSettingsPasswordRequired;
                title   = TextKey.PasswordDialog_LocalSettingsPasswordRequiredTitle;
                break;

            case PasswordRequestPurpose.Settings:
                message = TextKey.PasswordDialog_SettingsPasswordRequired;
                title   = TextKey.PasswordDialog_SettingsPasswordRequiredTitle;
                break;
            }

            var dialog = uiFactory.CreatePasswordDialog(text.Get(message), text.Get(title));
            var result = dialog.Show();

            runtime.SubmitPassword(args.RequestId, result.Success, result.Password);
            logger.Info($"Password request with id '{args.RequestId}' was {(result.Success ? "successful" : "aborted by the user")}.");

            if (!result.Success)
            {
                splashScreen?.Close();
            }
        }
        public bool TryStart()
        {
            logger.Info("Initiating startup procedure...");

            splashScreen = uiFactory.CreateSplashScreen();
            operations.ProgressChanged += Operations_ProgressChanged;
            operations.StatusChanged   += Operations_StatusChanged;

            var success = operations.TryPerform() == OperationResult.Success;

            if (success)
            {
                RegisterEvents();
                ShowShell();
                StartBrowser();

                var communication = runtime.InformClientReady();

                if (communication.Success)
                {
                    logger.Info("Application successfully initialized.");
                    logger.Log(string.Empty);
                }
                else
                {
                    success = false;
                    logger.Error("Failed to inform runtime that client is ready!");
                }
            }
            else
            {
                logger.Info("Application startup aborted!");
                logger.Log(string.Empty);
            }

            splashScreen.Close();

            return(success);
        }
예제 #8
0
        public bool TryStart()
        {
            logger.Info("Initiating startup procedure...");

            runtimeWindow = uiFactory.CreateRuntimeWindow(appConfig);
            splashScreen  = uiFactory.CreateSplashScreen(appConfig);

            bootstrapSequence.ProgressChanged += BootstrapSequence_ProgressChanged;
            bootstrapSequence.StatusChanged   += BootstrapSequence_StatusChanged;
            sessionSequence.ActionRequired    += SessionSequence_ActionRequired;
            sessionSequence.ProgressChanged   += SessionSequence_ProgressChanged;
            sessionSequence.StatusChanged     += SessionSequence_StatusChanged;

            splashScreen.Show();

            var initialized = bootstrapSequence.TryPerform() == OperationResult.Success;

            if (initialized)
            {
                RegisterEvents();

                logger.Info("Application successfully initialized.");
                logger.Log(string.Empty);
                logger.Subscribe(runtimeWindow);
                splashScreen.Close();

                StartSession();
            }
            else
            {
                logger.Info("Application startup aborted!");
                logger.Log(string.Empty);

                messageBox.Show(TextKey.MessageBox_StartupError, TextKey.MessageBox_StartupErrorTitle, icon: MessageBoxIcon.Error, parent: splashScreen);
            }

            return(initialized && SessionIsRunning);
        }