public void Redo(object instigator) { TextUndoUnit unit = null; using (var pencil = GetPencil(forUndoRedo: true)) { if (this.redoStack.Count > 0) { unit = this.redoStack.Pop(); NotifyBeforeUndoRedo(unit, instigator, isUndo: false); unit.Redo(pencil); this.undoStack.Push(unit); } } if (unit != null) { NotifyAfterUndoRedo(unit, instigator, isUndo: false); } }