Ejemplo n.º 1
0
        public void Undo(ChangeSet value)
        {
            bool done = false;
            _isWorking = true;
            try
            {
                do
                {
                    ChangeSet changeSet = _undoStack.Pop();

                    if (changeSet == value || _undoStack.Count == 0)
                        done = true;

                    changeSet.Undo();

                    _redoStack.Push(changeSet);
                    RaiseStateChangeEvent();
                } while (!done);
            }
            finally
            {
                _isWorking = false;
            }
        }
Ejemplo n.º 2
0
        public void BeginChangeSetBatch(string batchDescription)
        {
            if (_isBatch)
                return;

            _batchCounter++;
            _isBatch = true;

            if (_batchCounter == 1)
            {
                _currentBatch = new ChangeSet(batchDescription);
                _undoStack.Push(_currentBatch);
            }
        }
Ejemplo n.º 3
0
        public void EndChangeSetBatch()
        {
            _batchCounter--;

            if (_batchCounter < 0)
                _batchCounter = 0;

            if (_batchCounter == 0)
            {
                _currentBatch = null;
                _isBatch = false;
            }
        }