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