private void OnSolutionBindingChanged(object sender, ActiveSolutionBindingEventArgs binding)
 {
     if (binding.Configuration.Mode != NewConnectedMode.SonarLintMode.Standalone)
     {
         VisualStudioStatusBarHelper.AddStatusBarIcon(notificationIcon);
         notifications.StartAsync(binding.Configuration.Project.ProjectKey, notificationData);
     }
     else
     {
         notifications.Stop();
         VisualStudioStatusBarHelper.RemoveStatusBarIcon(notificationIcon);
     }
 }
Beispiel #2
0
 private void OnSolutionBindingChanged(object sender, ActiveSolutionBindingEventArgs binding)
 {
     if (binding.IsBound)
     {
         VisualStudioStatusBarHelper.AddStatusBarIcon(notificationIcon);
         notifications.StartAsync(binding.ProjectKey, notificationData);
     }
     else
     {
         notifications.Stop();
         VisualStudioStatusBarHelper.RemoveStatusBarIcon(notificationIcon);
     }
 }
Beispiel #3
0
        private void Refresh(BindingConfiguration bindingConfiguration)
        {
            Debug.Assert(ThreadHelper.CheckAccess());

            if (bindingConfiguration.Mode != SonarLintMode.Standalone)
            {
                logger.WriteLine(Resources.Strings.Notifications_Connected);
                VisualStudioStatusBarHelper.AddStatusBarIcon(notificationIcon);
                notifications.StartAsync(bindingConfiguration.Project.ProjectKey, notificationData);
            }
            else
            {
                logger.WriteLine(Resources.Strings.Notifications_NotConnected);
                notifications.Stop();
                VisualStudioStatusBarHelper.RemoveStatusBarIcon(notificationIcon);
            }
        }
        private void OnSolutionBindingChanged(object sender, ActiveSolutionBindingEventArgs binding)
        {
            if (notificationIcon == null)
            {
                notificationIcon             = new NotificationIndicator();
                notificationIcon.DataContext = notifications.Model;
                VisualStudioStatusBarHelper.AddStatusBarIcon(notificationIcon);
            }

            if (binding.IsBound)
            {
                notifications.StartAsync(binding.ProjectKey, notificationData);
            }
            else
            {
                notifications.Stop();
            }
        }
        protected override void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            base.Dispose(disposing);

            if (notificationIcon != null)
            {
                VisualStudioStatusBarHelper.RemoveStatusBarIcon(notificationIcon);
            }

            activeSolutionBoundTracker.SolutionBindingChanged -= OnSolutionBindingChanged;

            (notifications as IDisposable)?.Dispose();
            disposed = true;
        }