public object Create(IAnalysisIssueBase analysisIssueBase) { var ruleUrl = ruleHelpLinkProvider.GetHelpLink(analysisIssueBase.RuleKey); var hyperLink = new Hyperlink { Inlines = { analysisIssueBase.RuleKey }, Foreground = GetVsThemedColor(EnvironmentColors.ControlLinkTextColorKey), TextDecorations = null, Command = new DelegateCommand(o => browserService.Navigate(ruleUrl)) }; var content = new TextBlock { Inlines = { hyperLink, ": ", analysisIssueBase.Message }, Foreground = GetVsThemedColor(EnvironmentColors.SystemCaptionTextBrushKey) }; return(content); }
public void ShowIssue(string issueKey) { if (string.IsNullOrEmpty(issueKey)) { throw new ArgumentNullException(nameof(issueKey)); } var bindingConfiguration = configurationProvider.GetConfiguration(); if (bindingConfiguration.Equals(BindingConfiguration.Standalone)) { return; } var projectKey = bindingConfiguration.Project.ProjectKey; var viewIssueUrl = sonarQubeService.GetViewIssueUrl(projectKey, issueKey); vsBrowserService.Navigate(viewIssueUrl.ToString()); }
// For testing internal NotificationIndicatorViewModel(IServerNotificationsTelemetryManager telemetryManager, IVsBrowserService vsBrowserService, Action <Action> uiThreadInvoker, ITimer autocloseTimer) { this.telemetryManager = telemetryManager; this.uiThreadInvoker = uiThreadInvoker; this.autocloseTimer = autocloseTimer; NotificationEvents = new ObservableCollection <SonarQubeNotification>(); text = BuildToolTipText(); autocloseTimer.Elapsed += OnAutocloseTimerElapsed; ClearUnreadEventsCommand = new RelayCommand(() => HasUnreadEvents = false); NavigateToNotification = new DelegateCommand(parameter => { var notification = (SonarQubeNotification)parameter; vsBrowserService.Navigate(notification.Link.ToString()); IsToolTipVisible = false; telemetryManager.NotificationClicked(notification.Category); }); }