Пример #1
0
 private void Edit(Car item)
 {
   using (CarForm form = new CarForm(_model, item, false))
   {
     if (form.ShowDialog() != DialogResult.OK)
       item.RejectChanges();
   }
 }
Пример #2
0
    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);
        }
      }
    }