private BaseEvent ProcessBatch(BatchEvent batchEvent) { if (batchEvent.Count == 0) { return(null); } if (batchEvent.Count == 1) { return(batchEvent.Pop()); } return(batchEvent); }
/// <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); }