Ejemplo n.º 1
0
        private void EditSelectedFilter_EventHandler(object sender, EventArgs e)
        {
            if (listViewFilters.SelectedItems.Count > 0)
            {
                ListViewItem item = listViewFilters.SelectedItems[0];
                using (EditFilterForm frm = new EditFilterForm())
                {
                    frm.Filter = (IpProxyFilterFactory)item.Tag;

                    if (frm.ShowDialog(this) == DialogResult.OK)
                    {
                        if (!_readOnly)
                        {
                            IpProxyFilterFactory filter = frm.Filter;

                            item.Text = filter.ToString();
                            item.Tag  = filter;

                            ResizeColumns();
                        }
                    }
                }

                UpdateFilters();
            }
        }
Ejemplo n.º 2
0
        private void toggleEnabledToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listViewFilters.SelectedItems.Count > 0)
            {
                if (!_readOnly)
                {
                    IpProxyFilterFactory factory = (IpProxyFilterFactory)listViewFilters.SelectedItems[0].Tag;

                    factory.Disabled = !factory.Disabled;

                    listViewFilters.SelectedItems[0].Text = factory.ToString();

                    UpdateFilters();
                    ResizeColumns();
                }
            }
        }