public void AppendPacket(Packet_old tmpPacket)
        {
            string itemText = tmpPacket.ToString();
            Color col;
            if (tmpPacket.Dir == Direction.SC)
            {
                col = Colors.LightBlue;
            }
            else
            {
                col = Colors.WhiteSmoke;
            }

            Dispatcher.BeginInvoke(
                new Action(
                    delegate
                    {
                        ListBoxItem item = new ListBoxItem
                        {
                            Content = itemText,
                            Background = new SolidColorBrush(col)
                        };

                        while (boxPackets.Items.Count >= maxPackets)
                        {
                            boxPackets.Items.RemoveAt(0);
                            pp.Packets.RemoveAt(0);
                        }

                        if (filter.ShowPacket(tmpPacket))
                        {
                            boxPackets.Items.Add(item);

                            if (boxAutoScroll.IsChecked.Value)
                            {
                                boxPackets.ScrollIntoView(item);
                            }

                            pp.Packets.Add(tmpPacket);
                        }
                    }));
        }