private void Edit(Car item) { using (CarForm form = new CarForm(_model, item, false)) { if (form.ShowDialog() != DialogResult.OK) item.RejectChanges(); } }
private void _btnAdd_Click(object sender, EventArgs e) { Car item = _model.CarCreateInstance(); using (CarForm form = new CarForm(_model, item, true)) { if (form.ShowDialog() == DialogResult.OK) { item.AcceptChanges(); objectBinder.List.Add(item); } } }