Exemplo n.º 1
0
 public void StartTransaction(UndoTransaction tran)
 {
     if (_curTran == null)
     {
         _curTran = tran;
         ListOperations.Push(_undoActions, new UndoTransaction(tran.Name));
         ListOperations.Push(_redoActions, new UndoTransaction(tran.Name));
     }
 }
Exemplo n.º 2
0
        public void EndTransaction(UndoTransaction tran)
        {
            if (_curTran == tran)
            {
                _curTran = null;
                if (_undoActions.Count > 0)
                {
                    UndoTransaction t = _undoActions[0] as UndoTransaction;
                    if (t != null && t.OperationsCount == 0)
                    {
                        ListOperations.Pop(_undoActions);
                    }
                }

                if (_redoActions.Count > 0)
                {
                    UndoTransaction t = _redoActions[0] as UndoTransaction;
                    if (t != null && t.OperationsCount == 0)
                    {
                        ListOperations.Pop(_redoActions);
                    }
                }
            }
        }