public void IncrementSavePoint()
{
if (++this.CurrentSavePoint == this.MaxUndoRedoCount)
{
this.CurrentSavePoint = 0;
}
if (this.CurrentSavePoint == this.FirstSavePoint)
{
// we've wrapped round to start re-using the buffer space so we need to move the firstSavePoint on one
// as well to ensure we don't loop too far when undoing the changes
if (++this.FirstSavePoint == this.MaxUndoRedoCount)
{
this.FirstSavePoint = 0;
}
}
}