Example #1
0
 private void toolStripButtonFilter_Click(object sender, EventArgs e)
 {
     if (m_socket == null && m_filter != null)
     {
         FormFilter formConfig = new FormFilter();
         formConfig.SetFilter(m_filter);
         DialogResult dr = formConfig.ShowDialog(this);
     }
 }
Example #2
0
        private void comboBoxFilters_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBoxFilters.SelectedIndex != 0 && comboBoxFilters.SelectedIndex != (comboBoxFilters.Items.Count - 1))
            {
                toolStripButtonFilter.Enabled = true;
            }
            else
            {
                toolStripButtonFilter.Enabled = false;
            }

            if (comboBoxFilters.SelectedIndex == 0)
            {
                m_filterCurIndex = comboBoxFilters.SelectedIndex;
                m_filter         = null;
            }
            else if (comboBoxFilters.SelectedIndex == (comboBoxFilters.Items.Count - 1))
            {
                comboBoxFilters.SelectedIndex = m_filterCurIndex;

                FormFilter   formConfig = new FormFilter();
                DialogResult dr         = formConfig.ShowDialog(this);
                if (dr == DialogResult.OK)
                {
                    SnifferFilter filter = formConfig.GetFilter();
                    if (filter != null)
                    {
                        comboBoxFilters.Items.Insert((comboBoxFilters.Items.Count - 2), filter);
                    }
                }
            }
            else
            {
                m_filterCurIndex = comboBoxFilters.SelectedIndex;
                m_filter         = (SnifferFilter)comboBoxFilters.SelectedItem;
            }
        }