Ejemplo n.º 1
0
 private void m_pFilters_DoubleClick(object sender, EventArgs e)
 {
     if (this.m_pFilters.SelectedItems.Count > 0)
     {
         Filter            filter            = (Filter)this.m_pFilters.SelectedItems[0].Tag;
         AddEditFilterForm addEditFilterForm = new AddEditFilterForm(this.m_pVirtualServer, filter);
         if (addEditFilterForm.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadFilters(addEditFilterForm.FilterID);
         }
     }
 }
Ejemplo n.º 2
0
 private void SwitchToolBarTask(string taskID)
 {
     if (taskID == "add")
     {
         AddEditFilterForm addEditFilterForm = new AddEditFilterForm(this.m_pVirtualServer);
         if (addEditFilterForm.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadFilters(addEditFilterForm.FilterID);
             return;
         }
     }
     else if (taskID == "edit")
     {
         Filter            filter             = (Filter)this.m_pFilters.SelectedItems[0].Tag;
         AddEditFilterForm addEditFilterForm2 = new AddEditFilterForm(this.m_pVirtualServer, filter);
         if (addEditFilterForm2.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadFilters(addEditFilterForm2.FilterID);
             return;
         }
     }
     else if (taskID == "delete")
     {
         Filter filter2 = (Filter)this.m_pFilters.SelectedItems[0].Tag;
         if (MessageBox.Show(this, "Are you sure you want to delete Filter '" + filter2.Description + "' !", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             filter2.Owner.Remove(filter2);
             this.m_pFilters.SelectedItems[0].Remove();
             return;
         }
     }
     else
     {
         if (taskID == "refresh")
         {
             this.LoadFilters("");
             return;
         }
         if (taskID == "up")
         {
             if (this.m_pFilters.SelectedItems.Count > 0 && this.m_pFilters.SelectedItems[0].Index > 0)
             {
                 this.SwapFilters(this.m_pFilters.SelectedItems[0], this.m_pFilters.Items[this.m_pFilters.SelectedItems[0].Index - 1]);
                 return;
             }
         }
         else if (taskID == "down" && this.m_pFilters.SelectedItems.Count > 0 && this.m_pFilters.SelectedItems[0].Index < this.m_pFilters.Items.Count - 1)
         {
             this.SwapFilters(this.m_pFilters.SelectedItems[0], this.m_pFilters.Items[this.m_pFilters.SelectedItems[0].Index + 1]);
         }
     }
 }