Exemplo n.º 1
0
        public IMemento Restore()
        {
            // Before
            textContainer.Invalidate();
            TextChangeMemento oldState = new TextChangeMemento(textContainer);

            textContainer.ChangeText(oldText, false);
            // After
            textContainer.Invalidate();
            return(oldState);
        }
Exemplo n.º 2
0
        public IMemento Restore()
        {
            // Before
            _textContainer.Invalidate();
            var oldState = new TextChangeMemento(_textContainer);

            _textContainer.ChangeText(_oldText, false);
            // After
            _textContainer.Invalidate();
            return(oldState);
        }