Пример #1
0
        public PacketLogControl()
        {
            // Create a default list
            _packets = new LogPacketCollection();
            _autoScroll = false;
            _currentCol = null;
            components = new Container();

            InitializeComponent();

            UpdateConfig(DocumentControl.GetConfigItem<PacketLogControlConfig>(DEFAULT_CONFIG_NAME, true));
        }
Пример #2
0
        private void listLogPackets_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            PacketLogColumn col = (PacketLogColumn)listLogPackets.Columns[e.Column].Tag;

            if (col == _currentCol)
            {
                _sortAscending = !_sortAscending;
            }
            else
            {
                _sortAscending = true;
            }

               _currentCol = col;

               SortPackets(col, _sortAscending);
               listLogPackets.Invalidate();
        }
Пример #3
0
 public void Sort(PacketLogColumn col)
 {
 }
Пример #4
0
        void SortPackets(PacketLogColumn column, bool ascending)
        {
            lock(_packets)
            {
                LogPacket[] packets = null;

                packets = column.OrderBy(_packets, ascending).ToArray();

                _packets.Clear();
                foreach (LogPacket p in packets)
                {
                    _packets.Add(p);
                }
            }
        }