void AddIssue(ProjectFile file, BaseCodeIssueProvider provider, CodeIssue r) { var topLevelProvider = (provider as CodeIssueProvider) ?? provider.Parent; if (topLevelProvider == null) { throw new ArgumentException("must be a CodeIssueProvider or a BaseCodeIssueProvider with Parent != null", "provider"); } var issue = new IssueSummary { IssueDescription = r.Description, Region = r.Region, ProviderTitle = topLevelProvider.Title, ProviderDescription = topLevelProvider.Description, ProviderCategory = topLevelProvider.Category, Severity = topLevelProvider.GetSeverity(), File = file, Project = file.Project, InspectorIdString = r.InspectorIdString }; issue.Actions = r.Actions.Select(a => new ActionSummary { Batchable = a.SupportsBatchRunning, SiblingKey = a.SiblingKey, Title = a.Title, Region = a.DocumentRegion, IssueSummary = issue }).ToList(); IssueSink.AddIssue(issue); }
void AddIssue(ProjectFile file, CodeIssueProvider provider, CodeIssue r) { var issue = new IssueSummary { IssueDescription = r.Description, Region = r.Region, ProviderTitle = provider.Title, ProviderDescription = provider.Description, ProviderCategory = provider.Category, Severity = provider.GetSeverity(), IssueMarker = provider.IssueMarker, File = file, Project = file.Project, InspectorIdString = r.InspectorIdString }; issue.Actions = r.Actions.Select(a => new ActionSummary { Batchable = a.SupportsBatchRunning, SiblingKey = a.SiblingKey, Title = a.Title, Region = a.DocumentRegion, IssueSummary = issue }).ToList(); IssueSink.AddIssue(issue); }