Beispiel #1
0
 private BaseEvent ProcessBatch(BatchEvent batchEvent)
 {
     if (batchEvent.Count == 0)
     {
         return(null);
     }
     if (batchEvent.Count == 1)
     {
         return(batchEvent.Pop());
     }
     return(batchEvent);
 }
Beispiel #2
0
        /// <summary>
        /// Performs a redo.
        /// </summary>
        public void Redo()
        {
            if (!CanRedo)
            {
                throw new InvalidOperationException("There is nothing to redo");
            }
            if (IsInBatch)
            {
                throw new InvalidOperationException("Finish the active batch first");
            }

            var @event = _redoStack.Pop();

            RollbackEvent(@event is BatchEvent ? new BatchEvent((BatchEvent)@event) : @event, false);
            NotifyChange(@event);
        }