Example #1
0
 public void Remove(IILStubEventFilter filter)
 {
     m_filterList.Remove(filter);
 }
Example #2
0
 private void toolStripButtonRefresh_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         ILStubEventFilterList listFilter = new ILStubEventFilterList();
         int rowCount = dataGridViewFilter.Rows.Count;
         for (int i = 0; i < rowCount; i++)
         {
             DataGridViewRow dataGridViewRow = dataGridViewFilter.Rows[i];
             if (dataGridViewRow.IsNewRow)
             {
                 continue;
             }
             if (dataGridViewRow.Cells[0].Value == null)
             {
                 MessageBox.Show("The field of row " + (i + 1) + " is empty.");
                 return;
             }
             string filterName = dataGridViewRow.Cells[0].Value.ToString();
             IILStubEventFilterDef filterDef =
                 ILStubEventFilterManager.GetInstance().GetFilterDef(filterName);
             Debug.Assert(filterDef != null);
             if (dataGridViewRow.Cells[1].Value == null)
             {
                 MessageBox.Show("The operation of row '" + filterName + "' is empty.");
                 return;
             }
             string operaton = dataGridViewRow.Cells[1].Value.ToString();
             if (dataGridViewRow.Cells[2].Value == null)
             {
                 MessageBox.Show("The value of row '" + filterName + "' is empty.");
                 return;
             }
             string value = dataGridViewRow.Cells[2].Value.ToString();
             try
             {
                 IILStubEventFilter filter = filterDef.CreateFilter(operaton, value);
                 listFilter.Add(filter);
             }
             catch (FilterOperationIsNullException ex)
             {
                 MessageBox.Show(String.Format(
                                     Resource.ResourceManager.GetString("Wrn_FilterOperationIsNull"), ex.FilterName));
                 return;
             }
             catch (FilterOperationNotSupportException ex)
             {
                 MessageBox.Show(String.Format(
                                     Resource.ResourceManager.GetString("Wrn_FilterOperationNotSupport"),
                                     ex.Operation, ex.FilterName));
                 return;
             }
             catch (FilterValueIsNullException ex)
             {
                 MessageBox.Show(String.Format(
                                     Resource.ResourceManager.GetString("Wrn_FilterValueIsNull"), ex.FilterName));
                 return;
             }
             catch (FilterValueNotIntegerException ex)
             {
                 MessageBox.Show(String.Format(
                                     Resource.ResourceManager.GetString("Wrn_FilterValueNotInteger"),
                                     ex.Value, ex.FilterName));
                 return;
             }
         }
         m_filterList = listFilter;
         UpdateFilterMessage();
         UpdateEventList();
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #3
0
 public void Add(IILStubEventFilter filter)
 {
     m_filterList.Add(filter);
 }