public void CommitUndoTransaction(string transactionName) { if (_undoTransaction != null && _undoTransaction.ContainsKey(transactionName)) { MathExpGroupUndo _currStates = _undoTransaction[transactionName]; MathExpGroupUndo objRedo = new MathExpGroupUndo(this, (MathExpGroup)root.Export().Clone()); UndoEntity undo = new UndoEntity(_currStates, objRedo); _undoTransaction.Remove(transactionName); _undoEngine.AddUndoEntity(undo); enableUndo(); _disableUndo = false; } }
public void AddUndoEntity(UndoEntity entity) { if (!_disableUndo) { _undoEngine.AddUndoEntity(entity); OnHasUndoChange(); } }