Example #1
0
        IMementoWide CreateMemento()
        {
            MyMemento m = new MyMemento();

            foreach (var pair in _state)
            {
                m.AddToState(pair.Key, pair.Value);
            }

            return(m);
        }
Example #2
0
        IMementoWide CreateMemento()
        {
            MyMemento m = new MyMemento();

            foreach (var pair in _state)
            {
                m.AddToState(pair.Key, pair.Value);
            }

            return m;
        }
Example #3
0
        // restore state from given memento
        void SetMemento(MyMemento m)
        {
            _state.Clear();

            // TODO: use m.State to restore _state;
        }
Example #4
0
        // restore state from given memento
        void SetMemento(MyMemento m)
        {
            _state.Clear();

            // TODO: use m.State to restore _state;
        }