Exemplo n.º 1
0
 /// <summary>
 /// Handles the Click event of the AddFilterButton control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void AddFilterButton_Click(object sender, EventArgs e)
 {
     FilterDialog dlg = new FilterDialog(new FilterDialog.FilterEntry(false, null, null));
     if (dlg.ShowDialog(this) == DialogResult.OK)
     {
         listView.Items.Add(dlg.Filter.CreateListViewItem());
         FilenameTester_TextChanged(sender, e);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Handles the Click event of the EditFilterButton control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 private void EditFilterButton_Click(object sender, EventArgs e)
 {
     if (listView.SelectedItems.Count == 1 && listView.SelectedItems[0].Tag is FilterDialog.FilterEntry)
     {
         FilterDialog dlg = new FilterDialog((FilterDialog.FilterEntry)listView.SelectedItems[0].Tag);
         if (dlg.ShowDialog(this) == DialogResult.OK)
         {
             listView.SelectedItems[0].Tag = dlg.Filter;
             listView.SelectedItems[0].Text = dlg.Filter.DisplayValue;
             listView.SelectedItems[0].ImageKey = dlg.Filter.ImageKey;
             FilenameTester_TextChanged(sender, e);
         }
     }
 }