private void AddFilter() { FormFilterDetails formDetails = new FormFilterDetails(); Solver.Filter filter = formDetails.ShowDialog(null); if (filter == null) { return; } /*int index = listBoxFilters.SelectedIndex; * if (index == -1) * index = listBoxFilters.Items.Count; * listBoxFilters.Items.Insert(index, filter);*/ listBoxFilters.Items.Add(filter); listBoxFilters.SelectedIndex = listBoxFilters.Items.Count - 1; // not preset anymore ddPresets.SelectedIndex = -1; }
private void EditFilter() { int index = listBoxFilters.SelectedIndex; if (index == -1) { return; } Solver.Filter filter = (Solver.Filter)listBoxFilters.SelectedItem; FormFilterDetails formDetails = new FormFilterDetails(); filter = formDetails.ShowDialog(filter); if (filter == null) { return; } listBoxFilters.Items.RemoveAt(index); listBoxFilters.Items.Insert(index, filter); listBoxFilters.SelectedIndex = index; // not preset anymore ddPresets.SelectedIndex = -1; }
private void EditFilter() { int index = listBoxFilters.SelectedIndex; if (index == -1) return; Solver.Filter filter = (Solver.Filter)listBoxFilters.SelectedItem; FormFilterDetails formDetails = new FormFilterDetails(); filter = formDetails.ShowDialog(filter); if (filter == null) return; listBoxFilters.Items.RemoveAt(index); listBoxFilters.Items.Insert(index, filter); listBoxFilters.SelectedIndex = index; // not preset anymore ddPresets.SelectedIndex = -1; }
private void AddFilter() { FormFilterDetails formDetails = new FormFilterDetails(); Solver.Filter filter = formDetails.ShowDialog(null); if (filter == null) return; /*int index = listBoxFilters.SelectedIndex; if (index == -1) index = listBoxFilters.Items.Count; listBoxFilters.Items.Insert(index, filter);*/ listBoxFilters.Items.Add(filter); listBoxFilters.SelectedIndex = listBoxFilters.Items.Count - 1; // not preset anymore ddPresets.SelectedIndex = -1; }