Ejemplo n.º 1
0
 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];
     }
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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();
        }