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

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

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