Ejemplo n.º 1
0
 public void Undo()
 {
     if (LastPerformedCommandIdx > -1)
     {
         var command = commands[LastPerformedCommandIdx];
         command.Undo();
         --LastPerformedCommandIdx;
         command.Undone?.Invoke();
         Undone?.Invoke(command);
     }
 }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <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());
            }
        }
Ejemplo n.º 4
0
 /// <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);
 }
Ejemplo n.º 5
0
 public void Handle(IViewContext context, Undone domainEvent)
 {
     //context.DeleteThisViewInstance();
 }
 private void NotifyUndone()
 {
     Debug.Assert(Undone != null);
     Undone?.Invoke(this, new RoutedEventArgs());
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Called when after undone.
 /// </summary>
 /// <param name="undoUnit">The undo unit.</param>
 public virtual void OnUndone(IUndoUnit undoUnit)
 {
     Undone?.Invoke(this, undoUnit);
 }
Ejemplo n.º 8
0
 public void Apply(Undone e)
 {
 }