private void lvwMessages_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); NativeMethods.Msgs msg = (NativeMethods.Msgs)lvwMessages.Items[e.Index]; Brush br = SystemBrushes.WindowText; if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) { br = SystemBrushes.HighlightText; } if (_Watchs.ContainsKey(msg) && _Watchs[msg].Action != FormMain.BreakpointAction.None) { e.Graphics.DrawString(msg.ToString(), boltFont, br, e.Bounds); } else { e.Graphics.DrawString(msg.ToString(), lvwMessages.Font, br, e.Bounds); } }
private void FillList() { // first finish edit opeation FinishEdit(); lvwMessages.Items.Clear(); Array values = Enum.GetValues(typeof(NativeMethods.Msgs)); Array.Sort(values); string filter = txtFilter.Text; if (filter.Equals(Properties.Resources.Filter_Key)) { filter = string.Empty; } filter = filter.ToUpper(CultureInfo.InvariantCulture); bool onlyWatched = chkOnlyWactheds.Checked; CompareInfo info = CompareInfo.GetCompareInfo(1033); for (int i = 0; i < values.Length; i++) { NativeMethods.Msgs msg = (NativeMethods.Msgs)values.GetValue(i); if ((onlyWatched && !_Watchs.ContainsKey(msg)) || info.IndexOf(msg.ToString().ToUpper(CultureInfo.InvariantCulture), filter) == -1) { continue; } lvwMessages.Items.Add(msg); } foreach (KeyValuePair <NativeMethods.Msgs, FormMain.MessageBreakpoint> watch in _Watchs) { if (Array.IndexOf(values, watch.Key) == -1) { lvwMessages.Items.Add(watch.Key); } } }