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