public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var severity   = (AnalysisIssueSeverity)value;
            var vsSeverity = analysisSeverityToVsSeverityConverter.Convert(severity);

            switch (vsSeverity)
            {
            case __VSERRORCATEGORY.EC_ERROR:
                return(KnownMonikers.StatusError);

            case __VSERRORCATEGORY.EC_WARNING:
                return(KnownMonikers.StatusWarning);

            default:
                return(KnownMonikers.StatusInformation);
            }
        }
        public override bool TryGetValue(int index, string keyName, out object content)
        {
            if (index < 0 || index >= issues.Count || ShouldHideIssue(issues[index]))
            {
                content = null;
                return(false);
            }

            var issueViz = issues[index];
            var issue    = issueViz.Issue as IAnalysisIssue;

            switch (keyName)
            {
            case StandardTableKeyNames.DocumentName:
                content = AnalyzedFilePath;
                return(true);

            case StandardTableKeyNames.Line:
                // Note: the line and column numbers are taken from the SnapshotSpan, not the Issue.
                // The SnapshotSpan represents the live document, so the text positions could have
                // changed from those reported from the Issue.
                content = issueViz.Span.Value.Start.GetContainingLine().LineNumber;
                return(true);

            case StandardTableKeyNames.Column:
                // Use the span, not the issue. See comment immediately above.
                var position = issueViz.Span.Value.Start;
                var line     = position.GetContainingLine();
                content = position.Position - line.Start.Position;
                return(true);

            case StandardTableKeyNames.Text:
                content = issue.Message;
                return(true);

            case StandardTableKeyNames.ErrorSeverity:
                content = toVsSeverityConverter.Convert(issue.Severity);
                return(true);

            case StandardTableKeyNames.BuildTool:
                content = "SonarLint";
                return(true);

            case StandardTableKeyNames.ErrorCode:
                content = issue.RuleKey;
                return(true);

            case StandardTableKeyNames.ErrorRank:
                content = ErrorRank.Other;
                return(true);

            case StandardTableKeyNames.ErrorCategory:
                content = $"{issue.Severity} {ToString(issue.Type)}";
                return(true);

            case StandardTableKeyNames.ErrorCodeToolTip:
                content = $"Open description of rule {issue.RuleKey}";
                return(true);

            case StandardTableKeyNames.HelpLink:
                string ruleKey = issue.RuleKey;
                content = ruleHelpLinkProvider.GetHelpLink(ruleKey);
                return(true);

            case StandardTableKeyNames.ProjectName:
                content = projectName;
                return(true);

            case StandardTableKeyNames.ProjectGuid:
                content = projectGuid;
                return(true);

            // Not a visible field - returns the issue object
            case SonarLintTableControlConstants.IssueVizColumnName:
                content = issueViz;
                return(true);

            default:
                content = null;
                return(false);
            }
        }