Пример #1
0
        internal bool TryStart()
        {
            logger.Info("Initiating startup procedure...");

            operations.ActionRequired  += Operations_ActionRequired;
            operations.ProgressChanged += Operations_ProgressChanged;
            operations.StatusChanged   += Operations_StatusChanged;

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

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

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

                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.Hide();

            return(success);
        }
        internal bool TryStart()
        {
            logger.Info("Initiating startup procedure...");

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

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


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

            if (initialized)
            {
                RegisterEvents();

                RegisterCustomUrlProtocol(appConfig.SebUriScheme);
                RegisterCustomUrlProtocol(appConfig.SebUriSchemeSecure);

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

                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);
        }