/// <summary>
 /// This is called by the UndoHistory implementation when we are mid-undo/mid-redo and
 /// the history receives a new UndoableOperation. The action is then to add that operation
 /// to the inverse list.
 /// </summary>
 /// <param name="operation"></param>
 public void AddOperation(UndoableOperationCurried operation) {
     if (_state == DelegatedUndoPrimitiveState.Redoing) {
         _undoOperations.Push(operation);
     } else if (_state == DelegatedUndoPrimitiveState.Undoing) {
         RedoOperations.Push(operation);
     } else {
         throw new InvalidOperationException("Strings.DelegatedUndoPrimitiveStateDoesNotAllowAdd");
     }
 }
        public DelegatedUndoPrimitiveImpl(UndoHistoryImpl history, UndoTransactionImpl parent, UndoableOperationCurried operationCurried) {
            RedoOperations = new Stack<UndoableOperationCurried>();
            _undoOperations = new Stack<UndoableOperationCurried>();

            _parent = parent;
            _history = history;
            _state = DelegatedUndoPrimitiveState.Inactive;

            _undoOperations.Push(operationCurried);
        }
Exemplo n.º 3
0
 /// <summary>
 /// This is called by the UndoHistory implementation when we are mid-undo/mid-redo and
 /// the history receives a new UndoableOperation. The action is then to add that operation
 /// to the inverse list.
 /// </summary>
 /// <param name="operation"></param>
 public void AddOperation(UndoableOperationCurried operation)
 {
     if (this.state == DelegatedUndoPrimitiveState.Redoing)
     {
         undoOperations.Push(operation);
     }
     else if (this.state == DelegatedUndoPrimitiveState.Undoing)
     {
         redoOperations.Push(operation);
     }
     else
     {
         throw new InvalidOperationException("Strings.DelegatedUndoPrimitiveStateDoesNotAllowAdd");
     }
 }
Exemplo n.º 4
0
        public DelegatedUndoPrimitiveImpl(UndoHistoryImpl history, UndoTransactionImpl parent, UndoableOperationCurried operationCurried)
        {
            redoOperations = new Stack <UndoableOperationCurried>();
            undoOperations = new Stack <UndoableOperationCurried>();

            this.parent  = parent;
            this.history = history;
            this.state   = DelegatedUndoPrimitiveState.Inactive;

            undoOperations.Push(operationCurried);
        }