static void Main(string[] args) { Originator o = new Originator(); o.State = "On"; o.Show(); Caretaker c = new Caretaker(); c.memento = o.CreateMemento(); o.State = "Off"; o.Show(); o.SetMemento(c.memento); o.Show(); }
static void Main(string[] args) { Originator o = new Originator(); o.State = "on"; o.Show(); Caretaker c = new Caretaker(); c.Memento = o.CreateMemento(); o.State = "off"; o.Show(); o.SetMemento(c.Memento); o.Show(); Console.Read(); }
static void Main(string[] args) { Originator o = new Originator(); o.State = "On"; o.Show(); Caretaker c = new Caretaker(); c.Memento = o.CreateMemento(); o.State = "Off"; o.Show(); o.SetMemento(c.Memento); o.Show(); Console.Read(); }