Beispiel #1
0
        private void IFRUnreplaceBtn_Click(object sender, EventArgs e)
        {
            ListViewItem item   = IFRReplaceLstvw.GetSelectedItem();
            ushort       header = ushort.Parse(item.SubItems[1].Text);

            switch (item.SubItems[0].Text)
            {
            case "Client":
            {
                if (!_inReplacedHeaders.Contains(header))
                {
                    return;
                }
                _inReplacedHeaders.Remove(header);
                Game.Filters.InUnreplace(header);
                break;
            }

            case "Server":
            {
                if (!_outReplacedHeaders.Contains(header))
                {
                    return;
                }
                _outReplacedHeaders.Remove(header);
                Game.Filters.OutUnreplace(header);
                break;
            }
            }
            IFRReplaceLstvw.RemoveSelectedItem();
        }
Beispiel #2
0
        private void IFRReplaceBtn_Click(object sender, EventArgs e)
        {
            ushort header      = _headerToReplace;
            var    replacement = new HMessage(_replacement.ToBytes(), _replacement.Destination);

            switch (_replacement.Destination)
            {
            case HDestination.Client:
            {
                if (_inReplacedHeaders.Contains(header))
                {
                    return;
                }
                _inReplacedHeaders.Add(header);
                Game.Filters.InReplace(header, replacement);
                break;
            }

            case HDestination.Server:
            {
                if (_outReplacedHeaders.Contains(header))
                {
                    return;
                }
                _outReplacedHeaders.Add(header);
                Game.Filters.OutReplace(header, replacement);
                break;
            }
            }

            IFRReplaceLstvw.ItemChecked -= IFRReplaceLstvw_ItemChecked;
            IFRReplaceLstvw.FocusAdd(replacement.Destination.ToString(), header.ToString(), replacement.ToString())
            .Checked = true;
            IFRReplaceLstvw.ItemChecked += IFRReplaceLstvw_ItemChecked;
        }