private void CarObj2_button_Click(object sender, EventArgs e) { car = new Car(); car.Event += new MementoEvent(PatternsTestForm_EventHandler); car.SetName("Peugeot"); car.SetColor("Black"); car.SetSpeed(20); }
private void CarObj1_button_Click(object sender, EventArgs e) { car = new Car(); car.Event += new MementoEvent(PatternsTestForm_EventHandler); car.SetName("Toyota"); car.SetColor("Green"); car.SetSpeed(10); command.MakeBackup(car); }