Esempio n. 1
0
        /// <inheritdoc/>
        protected override void OnRedo()
        {
            // Remove last command from the redo list, execute it and add it to the undo list
            IUndoCommand lastCommand = RedoBackups.Pop();

            lastCommand.Execute();
            UndoBackups.Push(lastCommand);
        }
Esempio n. 2
0
        /// <summary>
        /// Called to redo the last undone change
        /// </summary>
        protected override void OnRedo()
        {
            // Remove the last backup from the redo list, then add the current backup to the undo list
            ICloneable toRestore = RedoBackups.Pop();

            UndoBackups.Push(_currentBackup);

            // Restore the backup and update the current backup
            Content        = (ICloneable)toRestore.Clone();
            _currentBackup = (ICloneable)Content.Clone();
        }