示例#1
0
        private void EditPacket()
        {
            var win        = new PacketEditWindow(CurrentPacket);
            var showDialog = win.ShowDialog();

            if (showDialog == null || !((bool)showDialog))
            {
                return;
            }
            var index = LbPackets.SelectedIndex;

            LbPackets.ItemsSource   = null;
            LbPackets.ItemsSource   = CurrentProtocol.Packets;
            LbPackets.SelectedIndex = index;
        }
        public Packet AddPacket(Protocol currentProtocol)
        {
            var packet = new Packet {
                                        Name = "",
                                        Description = "",
                                        Segments = new List<Segment>()
                                    };

            var win = new PacketEditWindow(packet);
            var showDialog = win.ShowDialog();
            if (showDialog != null && (bool) showDialog) {
                currentProtocol.Packets.Add(packet);
                return packet;
            }

            return null;
        }
 private void EditPacket()
 {
     var win = new PacketEditWindow(CurrentPacket);
     var showDialog = win.ShowDialog();
     if (showDialog == null || !((bool) showDialog)) return;
     var index = LbPackets.SelectedIndex;
     LbPackets.ItemsSource = null;
     LbPackets.ItemsSource = CurrentProtocol.Packets;
     LbPackets.SelectedIndex = index;
 }