Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }