/// <summary> /// Handles the <see cref="IWpfTableControl.EntriesChanged"/> event. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="EntriesChangedEventArgs"/>.</param> private void OnErrorListEntriesChanged(object sender, EntriesChangedEventArgs args) { var diagnostics = CurrentDiagnostics.ToDictionary(x => x.GetHashCode(), x => x); var tableEntries = args.AllEntries.ToLookup(x => x.DiagnosticInfoHashCode(), x => x); // remove entries which seems to be unused with the new diagnostic set. foreach (var item in diagnostics.Where(x => !tableEntries.Any(y => y.Key == x.Key)).Select(x => x.Key).ToList()) { diagnostics.Remove(item); } foreach (var item in tableEntries.Where(x => !diagnostics.ContainsKey(x.Key))) { diagnostics.Add(item.Key, item.First().ToDiagnosticInfo()); } CurrentDiagnostics = diagnostics.Select(x => x.Value).ToList(); DiagnosticsChanged?.Invoke(this, new DiagnosticsChangedEventArgs(CurrentDiagnostics)); }
private void ErrorListTableControl_EntriesChanged(object sender, EntriesChangedEventArgs e) { ThreadHelper.ThrowIfNotOnUIThread(); this.RefreshPersistentSpans(); }