private void OnIdeStartupComplete()
        {
            this.dteEvents.OnStartupComplete -= OnIdeStartupComplete;
            var settings = this.GetMefService <ISonarLintSettings>();

            if (settings.IsActivateMoreEnabled && daemon.IsInstalled)
            {
                if (!daemon.IsRunning)
                {
                    daemon.Start();
                }
            }
            else if (settings.IsActivateMoreEnabled)
            {
                // User already agreed to have the daemon installed, so directly start download
                new SonarLintDaemonInstaller(settings, daemon).Show();
            }
            else if (!settings.SkipActivateMoreDialog)
            {
                var result = new SonarLintDaemonSplashscreen(settings).ShowDialog();
                if (result == true)
                {
                    new SonarLintDaemonInstaller(settings, daemon).Show();
                }
            }
        }
Esempio n. 2
0
        private void LaunchActivateMoreDialog()
        {
            var result = new SonarLintDaemonSplashscreen().ShowDialog();

            if (result == true)
            {
                new SonarLintDaemonInstaller().Show();
            }
        }
        private async System.Threading.Tasks.Task InitAsync()
        {
            ILogger logger = null;

            try
            {
                logger = await this.GetMefServiceAsync <ILogger>();

                logger.WriteLine(Resources.Strings.Daemon_Initializing);

                daemon = await this.GetMefServiceAsync <ISonarLintDaemon>();

                var settings = await this.GetMefServiceAsync <ISonarLintSettings>();

                LegacyInstallationCleanup.CleanupDaemonFiles(logger);

                if (daemon.IsInstalled)
                {
                    if (settings.IsActivateMoreEnabled && !daemon.IsRunning)
                    {
                        daemon.Start();
                    }
                }
                else
                {
                    if (settings.IsActivateMoreEnabled)
                    {
                        // User already agreed to have the daemon installed, so directly start download
                        await JoinableTaskFactory.SwitchToMainThreadAsync();

                        new SonarLintDaemonInstaller(settings, daemon, logger).Show();
                    }
                    else if (!settings.SkipActivateMoreDialog)
                    {
                        await JoinableTaskFactory.SwitchToMainThreadAsync();

                        var result = new SonarLintDaemonSplashscreen(settings).ShowDialog();
                        if (result == true)
                        {
                            new SonarLintDaemonInstaller(settings, daemon, logger).Show();
                        }
                    }
                }
            }
            catch (Exception ex) when(!ErrorHandler.IsCriticalException(ex))
            {
                logger?.WriteLine(Resources.Strings.ERROR_InitializingDaemon, ex);
            }
            logger?.WriteLine(Resources.Strings.Daemon_InitializationComplete);
        }
Esempio n. 4
0
        private async System.Threading.Tasks.Task Init()
        {
            try
            {
                this.daemon = await this.GetMefServiceAsync <ISonarLintDaemon>();

                var settings = await this.GetMefServiceAsync <ISonarLintSettings>();

                var logger = await this.GetMefServiceAsync <ILogger>();

                LegacyInstallationCleanup.CleanupDaemonFiles(logger);

                if (settings.IsActivateMoreEnabled && daemon.IsInstalled)
                {
                    if (!daemon.IsRunning)
                    {
                        daemon.Start();
                    }
                }
                else if (settings.IsActivateMoreEnabled)
                {
                    // User already agreed to have the daemon installed, so directly start download
                    await JoinableTaskFactory.SwitchToMainThreadAsync();

                    new SonarLintDaemonInstaller(settings, daemon).Show();
                }
                else if (!settings.SkipActivateMoreDialog)
                {
                    await JoinableTaskFactory.SwitchToMainThreadAsync();

                    var result = new SonarLintDaemonSplashscreen(settings).ShowDialog();
                    if (result == true)
                    {
                        new SonarLintDaemonInstaller(settings, daemon).Show();
                    }
                }
            }
            catch (Exception)
            {
                // Log this
            }
        }