private void LoadCapture(object sender, RoutedEventArgs e) { PacketListView.Items.Clear(); currentPacketStream = new MemoryStream(new byte[] { }); isFiltered = false; OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "XML|*.xml"; openFileDialog.Title = "Select a Capture XML file"; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { var packets = CaptureFileOp.Load(openFileDialog.FileName); foreach (PacketListItem packet in packets) { AddPacketToListView(packet); } } }
public MainWindow() { ParseCommandlineArguments(); InitializeComponent(); repo = Properties.Settings.Default.RepoUrl; db = new Database(repo); captureMode = (TCPNetworkMonitor.NetworkMonitorType)Properties.Settings.Default.NetworkMonitorType; if (captureMode == TCPNetworkMonitor.NetworkMonitorType.RawSocket) { SwitchModeSockets.IsChecked = true; } else { SwitchModePcap.IsChecked = true; } // register the event that is fired after the key press. hook.KeyPressed += new EventHandler <KeyPressedEventArgs>(hook_KeyPressed); // register the control + alt + F12 combination as hot key. hotkeyTimer = new System.Threading.Timer(TryAssignHotkey, null, 0, 5); if (!string.IsNullOrEmpty(currentXmlFile)) { ChangeTitle(System.IO.Path.GetFileNameWithoutExtension(currentXmlFile)); var packets = CaptureFileOp.Load(currentXmlFile); foreach (PacketListItem packet in packets) { AddPacketToListView(packet); } } //var test = Struct.Parse(db.GetServerZoneStruct(0x143), new byte[] {}); }
private void LoadCapture(object sender, RoutedEventArgs e) { currentPacketStream = new MemoryStream(new byte[] { }); filterString = ""; OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "XML|*.xml"; openFileDialog.Title = "Select a Capture XML file"; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { MessageBoxResult res = MessageBox.Show("No to open in current, Yes to open in new window.", "Open in new window?", MessageBoxButton.YesNoCancel); if (res == MessageBoxResult.Yes) { Process.Start(System.IO.Path.Combine(Environment.CurrentDirectory, System.AppDomain.CurrentDomain.FriendlyName), "--xml \"" + openFileDialog.FileName + "\""); return; } else if (res == MessageBoxResult.No) { PacketListView.Items.Clear(); } else { return; } currentXmlFile = openFileDialog.FileName; ChangeTitle(System.IO.Path.GetFileNameWithoutExtension(currentXmlFile)); var packets = CaptureFileOp.Load(openFileDialog.FileName); foreach (PacketListItem packet in packets) { AddPacketToListView(packet); } } }