public CatchOperationsFromHistoryForDelegatedPrimitive(UndoHistoryImpl history, DelegatedUndoPrimitiveImpl primitive, DelegatedUndoPrimitiveState state) {
            _history = history;
            _primitive = primitive;

            primitive.State = state;
            history.ForwardToUndoOperation(primitive);
        }
Exemple #2
0
        public CatchOperationsFromHistoryForDelegatedPrimitive(UndoHistoryImpl history, DelegatedUndoPrimitiveImpl primitive, DelegatedUndoPrimitiveState state)
        {
            _history   = history;
            _primitive = primitive;

            primitive.State = state;
            history.ForwardToUndoOperation(primitive);
        }
 public UndoHistoryImpl(UndoHistoryRegistryImpl undoHistoryRegistry) {
     _currentTransaction = null;
     UndoHistoryRegistry = undoHistoryRegistry;
     _undoStack = new Stack<ITextUndoTransaction>();
     _redoStack = new Stack<ITextUndoTransaction>();
     _activeUndoOperationPrimitive = null;
     _state = TextUndoHistoryState.Idle;
 }
Exemple #4
0
        /// <summary>
        /// This method ends the lifetime of the activeUndoOperationPrimitive and should be called after ForwardToUndoOperation.
        /// </summary>
        /// <param name="primitive">The previously active delegated primitive--used for sanity check.</param>
        public void EndForwardToUndoOperation(DelegatedUndoPrimitiveImpl primitive)
        {
            if (_activeUndoOperationPrimitive != primitive)
            {
                throw new InvalidOperationException();
            }

            _activeUndoOperationPrimitive = null;
        }
Exemple #5
0
 public UndoHistoryImpl(UndoHistoryRegistryImpl undoHistoryRegistry)
 {
     _currentTransaction           = null;
     UndoHistoryRegistry           = undoHistoryRegistry;
     _undoStack                    = new Stack <ITextUndoTransaction>();
     _redoStack                    = new Stack <ITextUndoTransaction>();
     _activeUndoOperationPrimitive = null;
     _state = TextUndoHistoryState.Idle;
 }
        /// <summary>
        /// This method ends the lifetime of the activeUndoOperationPrimitive and should be called after ForwardToUndoOperation.
        /// </summary>
        /// <param name="primitive">The previously active delegated primitive--used for sanity check.</param>
        public void EndForwardToUndoOperation(DelegatedUndoPrimitiveImpl primitive) {
            if (_activeUndoOperationPrimitive != primitive) {
                throw new InvalidOperationException();
            }

            _activeUndoOperationPrimitive = null;
        }