public void Redo(TextPencil pencil)
 {
     if (this.changes != null)
     {
         // Changes get redone in original order
         for (int i = 0; i < this.changes.Count; i++)
         {
             var change = this.changes[i];
             pencil.Write(change.Start, change.OldEnd, change.Replacement);
         }
     }
 }
 public void Redo(TextPencil pencil)
 {
     if (this.changes != null)
     {
         // Changes get redone in original order
         for (int i = 0; i < this.changes.Count; i++)
         {
             var change = this.changes[i];
             pencil.Write(change.Start, change.OldEnd, change.Replacement);
         }
     }
 }
 public void Undo(TextPencil pencil)
 {
     if (this.changes != null)
     {
         // Changes get undone in reverse order
         for (int i = this.changes.Count - 1; i >= 0; i--)
         {
             var change = this.changes[i];
             pencil.Write(change.Start, change.NewEnd, change.OldTextData.GetSubrange(change.Start, change.OldEnd));
         }
     }
 }
 public void Undo(TextPencil pencil)
 {
     if (this.changes != null)
     {
         // Changes get undone in reverse order
         for (int i = this.changes.Count - 1; i >= 0; i--)
         {
             var change = this.changes[i];
             pencil.Write(change.Start, change.NewEnd, change.OldTextData.GetSubrange(change.Start, change.OldEnd));
         }
     }
 }