Ejemplo n.º 1
0
        private void HexEditor_OnOnSelectionStartChanged(object sender, EventArgs e)
        {
            DataTypeViewer.Apply(_currentPacketStream.ToArray(), (int)HexEditor.SelectionStart);

            int            i        = 0;
            StructListItem prevItem = null;

            foreach (StructListItem item in StructListView.Items)
            {
                if (prevItem != null)
                {
                    if (HexEditor.SelectionStart == item.offset)
                    {
                        StructListView.SelectedIndex = i;
                        StructListView.ScrollIntoView(item);
                        break;
                    }
                    else if (HexEditor.SelectionStart < item.offset && HexEditor.SelectionStart >= prevItem.offset)
                    {
                        StructListView.SelectedIndex = i - 1;
                        StructListView.ScrollIntoView(prevItem);
                        break;
                    }
                }
                prevItem = item;
                i++;
            }
        }
Ejemplo n.º 2
0
 private void HexEditor_OnOnSelectionStartChanged(object sender, EventArgs e)
 {
     DataTypeViewer.Apply(_currentPacketStream.ToArray(), (int)HexEditor.SelectionStart);
 }