private void DisplayIgnoredMessages(string type, IDictionary <ushort, bool> ignored) { foreach (ushort header in ignored.Keys) { ListViewItem item = IgnoredVw.AddItem(type, header); item.Tag = new Tuple <ushort, bool>(header, (type == "Outgoing")); item.Checked = ignored[header]; } }
private void IgnoreMessage(ushort header, bool isOutgoing) { IDictionary <ushort, bool> ignored = (isOutgoing ? _ignoredOutgoing : _ignoredIncoming); if (!ignored.ContainsKey(header)) { ignored[header] = true; ListViewItem item = IgnoredVw.AddItem( (isOutgoing ? "Outgoing" : "Incoming"), header); item.Checked = true; item.Tag = new Tuple <ushort, bool>(header, isOutgoing); } }
private void RemoveBtn_Click(object sender, EventArgs e) { ListViewItem item = IgnoredVw.SelectedItem; var ignoredMsg = (item.Tag as Tuple <ushort, bool>); if (ignoredMsg != null) { ushort header = ignoredMsg.Item1; bool isOutgoing = ignoredMsg.Item2; IDictionary <ushort, bool> ignored = (isOutgoing ? _ignoredOutgoing : _ignoredIncoming); if (ignored.ContainsKey(header)) { ignored.Remove(header); } } IgnoredVw.RemoveSelectedItem(); }