Example #1
0
        async Task TryLaunchWebserver()
        {
retry:
            try {
                var t = SetupWebServer();
            } catch (CannotOpenApiPortException ex) {
                var r = await
                        UserErrorHandler.RecoverableUserError(ex, "Unable to open required ports",
                                                              "We were unable to open the required port for the website to communicate with the client.\nAre there other instances already running on your system?\n\nIf you continue to experience this problem please contact support @ https://community.withsix.com")
                        .ConfigureAwait(false);

                if (r == RecoveryOptionResultModel.RetryOperation)
                {
                    goto retry;
                }
                _shutdownHandler.Shutdown(1);
                throw;
            } catch (Exception ex) {
                var r = await
                        UserErrorHandler.InformationalUserError(ex, "Unable to open required ports",
                                                                "We were unable to open the required port for the website to communicate with the client.\nAre there other instances already running on your system?\n\nIf you continue to experience this problem please contact support @ https://community.withsix.com")
                        .ConfigureAwait(false);

                _shutdownHandler.Shutdown(1);
                throw;
            }
        }
Example #2
0
 public bool InstallAndExitIfNotBusy()
 {
     if (!InstallIfNotBusy())
     {
         return(false);
     }
     _shutdownHandler.Shutdown();
     return(true);
 }
Example #3
0
 public virtual void FirstTimeLicenseDialog(object obj)
 {
     if (_settings.AppOptions.FirstTimeLicenceAccepted)
     {
         return;
     }
     if (!_firstTimeLicense.ConfirmLicense(obj))
     {
         _shutdownHandler.Shutdown();
         return;
     }
     _settings.AppOptions.FirstTimeLicenceAccepted = true;
 }
Example #4
0
        void Restart(bool elevated = false, bool exit = false, params string[] args)
        {
            var ps = GetSquirrelRestart(args);

            // TODO
            //if (elevated)
            //  ps.Verb = "runas";

            Common.OnExit = () => {
                using (Process.Start(ps)) {}
            };

            if (exit)
            {
                _shutdownHandler.Shutdown();
            }
        }
 private void CurrentDomain_DomainUnload()
 {
     _ShutdownHandler.Shutdown();
 }
Example #6
0
        public async Task Handle(Shutdown request)
        {
            await _contentInstallation.Abort().ConfigureAwait(false);

            _shutdownHandler.Shutdown();
        }
Example #7
0
 public Unit Handle(Shutdown request)
 {
     _shutdownHandler.Shutdown();
     return(Unit.Value);
 }