/// <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));
        }
Пример #2
0
        void OnDiagnosticsChanged()
        {
            WaitingForAnalysis = false;

            DiagnosticsChanged?.Invoke(this, EventArgs.Empty);
        }
Пример #3
0
 /// <summary>
 /// Raises the <see cref="DiagnosticsChanged"/> event.
 /// </summary>
 private void RaiseDiagnosticsChanged()
 {
     DiagnosticsChanged?.Invoke(this, new DiagnosticsChangedEventArgs(CurrentDiagnostics));
 }