private void ErrorSelected(object sender, EventArgs e) { elementList.BeginUpdate(); elementList.Nodes.Clear(); QuickFix[] fixes; if (errorNode == null) { elementList.EndUpdate(); return; } if (comboBox1.SelectedIndex == 0) { fixes = editor.ValidationManager.GetQuickFixes(errorNode); } else { ValidationError ve = comboBox1.SelectedItem as ValidationError; Debug.Assert(ve != null, "Expected ValidationError in combo!"); fixes = editor.ValidationManager.GetQuickFixes(ve); } QuickFixSorter s = new QuickFixSorter(fixes, 5); AddItems(s.TopItems, elementList.Nodes, true); elementList.EndUpdate(); }
private void ErrorSelected(object sender, EventArgs e) { elementList.BeginUpdate(); elementList.Nodes.Clear(); QuickFix[] fixes; if ( errorNode == null ) { elementList.EndUpdate(); return; } if ( comboBox1.SelectedIndex == 0 ) fixes=editor.ValidationManager.GetQuickFixes(errorNode); else { ValidationError ve=comboBox1.SelectedItem as ValidationError; Debug.Assert(ve != null, "Expected ValidationError in combo!"); fixes=editor.ValidationManager.GetQuickFixes(ve); } QuickFixSorter s=new QuickFixSorter(fixes, 5); AddItems(s.TopItems, elementList.Nodes, true); elementList.EndUpdate(); }