Esempio n. 1
0
        static public void Run()
        {
            Console.WriteLine("------------Memento------------");
            ComputerSystem computerSystem = new ComputerSystem("4.12");
            SystemHistory  history        = new SystemHistory();

            history.Points.Push(computerSystem.CreateSystemPoint());

            computerSystem.Version = "5.01";
            Console.WriteLine("New Version: " + computerSystem.Version);

            computerSystem.RestoreSystem(history.Points.Pop());
            Console.WriteLine("Version after restore: " + computerSystem.Version);
        }