示例#1
0
 private void OnActiveSolutionChanged(object sender, ActiveSolutionChangedEventArgs e)
 {
     try
     {
         if (e.IsSolutionOpen)
         {
             WarnIfAnyProjectHasSonarRuleSet();
         }
     }
     catch (Exception ex) when(!ErrorHandler.IsCriticalException(ex))
     {
         // Swallow the exception as we are on UI thread
     }
 }
示例#2
0
        private void OnActiveSolutionChanged(object sender, ActiveSolutionChangedEventArgs args)
        {
            // TODO: simplifying the eventing model.
            // Both this class and the ActiveSolutionBoundTracker both listen for solution closing events.
            // The ASBT can set the current configuration to Standalone, and this class reads the
            // configuration. However, we can't control the order they receive the "solution closing"
            // notification, so this class might try to read the configuration before it has been
            // updated by the ASBT.
            // To work round this, we have specifically check whether there is an open solution
            // so we do the right thing here.

            // Reset, and abort workflows
            this.ResetBinding(abortCurrentlyRunningWorklows: true, clearCurrentBinding: !args.IsSolutionOpen);
        }
        private async void OnActiveSolutionChanged(object sender, ActiveSolutionChangedEventArgs args)
        {
            // An exception here will crash VS
            try
            {
                await UpdateConnectionAsync();

                this.RaiseAnalyzersChangedIfBindingChanged();
                this.errorListInfoBarController.Refresh();
            }
            catch (Exception ex) when(!Microsoft.VisualStudio.ErrorHandler.IsCriticalException(ex))
            {
                logger.WriteLine($"Error handling solution change: {ex.Message}");
            }
        }