void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { var shiftCtrlModifier = ModifierKeys.Control | ModifierKeys.Shift; if (Keyboard.Modifiers == ModifierKeys.None) { _diagnosticService.GoToNextDiagnostic(); } else if ((Keyboard.Modifiers & shiftCtrlModifier) == shiftCtrlModifier && e.ClickCount == 2) { // Shift + Ctrl + Doubleclick // Kopieren der Diagnostics in die Zwischenablage für Unittests var errors = _diagnosticService.GetDiagnosticsWithSeverity(DiagnosticSeverity.Error).Select(d => d.Tag.Diagnostic); var warnings = _diagnosticService.GetDiagnosticsWithSeverity(DiagnosticSeverity.Warning).Select(d => d.Tag.Diagnostic); var suggestions = _diagnosticService.GetDiagnosticsWithSeverity(DiagnosticSeverity.Suggestion).Select(d => d.Tag.Diagnostic); var diagnostics = errors.Concat(warnings) .Concat(suggestions) .Aggregate( new StringBuilder(), (sb, diagnostic) => sb.AppendLine(diagnostic.ToString(UnitTestDiagnosticFormatter.Instance)), sb => sb.ToString()); Clipboard.SetText(diagnostics); // Neuberechnung der Diagnostik _diagnosticService.Invalidate(); } }
void EnsureGeometry() { if (_markerGeometryGroups != null) { return; } _markerGeometryGroups = new Dictionary <DiagnosticSeverity, GeometryGroup>(); var severities = new[] { DiagnosticSeverity.Error, DiagnosticSeverity.Warning, DiagnosticSeverity.Suggestion }; foreach (var severity in severities) { var group = new GeometryGroup(); foreach (var mappingTagSpan in _diagnosticService.GetDiagnosticsWithSeverity(severity)) { var tagSpan = _textView.MapToSingleSnapshotSpan(mappingTagSpan); if (tagSpan == null) { continue; } group.Children.Add(GetMarkerGeometry(tagSpan.Span.Start)); } _markerGeometryGroups.Add(severity, group); } }