public void Undo() { if (LastPerformedCommandIdx > -1) { var command = commands[LastPerformedCommandIdx]; command.Undo(); --LastPerformedCommandIdx; command.Undone?.Invoke(); Undone?.Invoke(command); } }
/// <summary> /// 撤销操作 /// </summary> /// <returns></returns> public OperationStack Undo() { IsRecording = false; var stack = UndoStack.Pop(); Undoing?.Invoke(stack.Item1, stack.Item2); RedoStack.Push(stack); Undone?.Invoke(stack.Item1, stack.Item2); IsRecording = true; return(stack.Item1); }
/// <summary> /// Undo last byteaction /// </summary> public void Undo() { if (CanUndo) { ByteModified last = _byteModifiedList.Last <ByteModified>(); for (int i = 0; i < last.UndoLenght; i++) { _byteModifiedList.RemoveAt(_byteModifiedList.Count - 1); } Undone?.Invoke(this, new EventArgs()); } }
/// <summary> /// Invoked Raised when an action item is undone. /// </summary> /// <param name="e">The arguments that will be passed to the <see cref="Undone"/> event raised by this method.</param> protected virtual void OnUndone(ActionItemsEventArgs <IActionItem> e) { Undone?.Invoke(this, e); }
public void Handle(IViewContext context, Undone domainEvent) { //context.DeleteThisViewInstance(); }
private void NotifyUndone() { Debug.Assert(Undone != null); Undone?.Invoke(this, new RoutedEventArgs()); }
/// <summary> /// Called when after undone. /// </summary> /// <param name="undoUnit">The undo unit.</param> public virtual void OnUndone(IUndoUnit undoUnit) { Undone?.Invoke(this, undoUnit); }
public void Apply(Undone e) { }