private void btnSettings_Click(object sender, EventArgs e) { if (boxFilters.SelectedIndex != -1) { Filter selected = (Filter)boxFilters.SelectedItem; Form form = null; if (selected.Type == FilterType.Item) { form = new ItemFilterEditor((ItemFilter)selected); } else if (selected.Type == FilterType.Name) { form = new NameFilterEditor((NameFilter)selected); } form.ShowDialog(); UpdateFilters(); } }
private void btnAdd_Click(object sender, EventArgs e) { Form form = null; Filter filter = null; SelectFilterForm select = new SelectFilterForm(); if (select.ShowDialog(this) == DialogResult.OK) { switch (select.Selected) { case FilterType.Item: { filter = new ItemFilter(); form = new ItemFilterEditor(filter); break; } case FilterType.Name: { filter = new NameFilter(); form = new NameFilterEditor(filter); break; } } } else { return; } if (form.ShowDialog(this) == DialogResult.OK) { Settings.filters.Add(filter); } UpdateFilters(); }
private void btnAdd_Click(object sender, EventArgs e) { Form form = null; Filter filter = null; SelectFilterForm select = new SelectFilterForm(); if (select.ShowDialog(this) == DialogResult.OK) { switch (select.Selected) { case FilterType.Item: { filter = new ItemFilter(); form = new ItemFilterEditor(filter); break; } case FilterType.Name: { filter = new NameFilter(); form = new NameFilterEditor(filter); break; } } } else return; if (form.ShowDialog(this) == DialogResult.OK) Settings.filters.Add(filter); UpdateFilters(); }
private void btnSettings_Click(object sender, EventArgs e) { if (boxFilters.SelectedIndex != -1) { Filter selected = (Filter)boxFilters.SelectedItem; Form form = null; if (selected.Type == FilterType.Item) form = new ItemFilterEditor((ItemFilter)selected); else if (selected.Type == FilterType.Name) form = new NameFilterEditor((NameFilter)selected); form.ShowDialog(); UpdateFilters(); } }