public void PushUndo(UndoObject uo) { if (IsEnabled) { _undoStack.PushOrCollapse(uo); _redoStack.Clear(); } }
public void PushUndo(UndoObject uo) { if (_framework.IsEnabled) { _framework.PushUndo(uo); OnPropertyChanged(nameof(RedoTitle)); OnPropertyChanged(nameof(UndoTitle)); } }
public Result Redo() { if (_redoStack.Count > 0) { UndoObject uo = _redoStack.Pop(); Disable(); Result r = uo.Redo(); Enable(); if (r.Type == ResultType.Good && IsEnabled) { _undoStack.Push(uo); } return(r); } else { return(new Result(ResultType.Bad, "Nothing to redo.")); } }
public virtual bool Collapse(UndoObject uo) { return(CanCollapse(uo)); }
public virtual bool CanCollapse(UndoObject uo) { return(IsCollapsible && uo != null && uo.IsCollapsible && (_undoContext as CollapsibleUndoContext).ContextReference == (uo._undoContext as CollapsibleUndoContext).ContextReference); }