Exemple #1
0
        public IMemento Restore()
        {
            // Before
            textContainer.Invalidate();
            TextChangeMemento oldState = new TextChangeMemento(textContainer);

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

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