public Solver.Filter ShowDialog(Solver.Filter filter) { if (filter == null) { Filter_ = null; Text = "Add Filter"; btnRevert.Enabled = false; } else { Filter_ = filter.DeepCopy(); Text = "Edit Filter"; btnRevert.Enabled = true; } LoadFromFilter(); DialogResult result = base.ShowDialog(); if (result == DialogResult.OK) return Filter_; return null; }
public Solver.Criteria ShowDialog(Solver.Criteria criteria) { if (criteria == null) { Criteria_ = null; Text = "Add Criteria"; btnRevert.Enabled = false; } else { Criteria_ = criteria.DeepCopy(); Text = "Edit Criteria"; btnRevert.Enabled = true; } LoadFromCriteria(); DialogResult result = base.ShowDialog(); if (result == DialogResult.OK) return Criteria_; return null; }