예제 #1
0
        private void filter_opt_Click(object sender, EventArgs e)
        {
            FilterDlg    dlg = new FilterDlg();
            DialogResult dr  = dlg.ShowDialog();

            if (dr == DialogResult.OK)
            {
                // User changed the filter
                // Restart capture using new filter if we are capturing now
                if (worker != null)
                {
                    object[] ctrls = new object[2];
                    ctrls[0] = frames;
                    ctrls[1] = clear_cap;

                    frames.Items.Clear();

                    if (!IsOffline)
                    {
                        worker.StopCapture();

                        PacketSniffer.ResetDetailsDumper();
                        worker.StartOfflineCapture(null, ctrls);

                        int deviceIndex = device_opt.SelectedIndex;
                        worker.StartCapture(deviceIndex, ctrls);
                    }
                    else
                    {
                        PacketSniffer.ResetDetailsDumper();
                        worker.StartOfflineCapture(OfflineDumpFile, ctrls);
                    }
                }
            }
        }
예제 #2
0
		private void filter_opt_Click(object sender, EventArgs e)
		{
			FilterDlg dlg = new FilterDlg();
			DialogResult dr = dlg.ShowDialog();
			if (dr == DialogResult.OK){
				// User changed the filter
				// Restart capture using new filter if we are capturing now
				if (worker != null) {
					object[] ctrls = new object[2];
					ctrls[0] = frames;
					ctrls[1] = clear_cap;

					frames.Items.Clear();

					if (!IsOffline) {
						worker.StopCapture();

						PacketSniffer.ResetDetailsDumper();
						worker.StartOfflineCapture(null, ctrls);

						int deviceIndex = device_opt.SelectedIndex;
						worker.StartCapture(deviceIndex, ctrls);
					}
					else {
						PacketSniffer.ResetDetailsDumper();
						worker.StartOfflineCapture(OfflineDumpFile, ctrls);
					}
				}
			}
		}