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

            primitive.State = state;
            history.ForwardToUndoOperation(primitive);
        }
コード例 #2
0
 public UndoHistoryImpl(UndoHistoryRegistryImpl undoHistoryRegistry) {
     _currentTransaction = null;
     UndoHistoryRegistry = undoHistoryRegistry;
     _undoStack = new Stack<ITextUndoTransaction>();
     _redoStack = new Stack<ITextUndoTransaction>();
     _activeUndoOperationPrimitive = null;
     _state = TextUndoHistoryState.Idle;
 }
コード例 #3
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;
        }