private int? SearchForward(int startIndex, string searchString)
{
// Check for out of bounds roll over if required
int index;
if (startIndex < 0 || startIndex >= Revisions.RowCount)
startIndex = 0;
for (index = startIndex; index < Revisions.RowCount; ++index)
{
if (GetRevision(index).MatchesSearchString(searchString))
return index;
}
// We didn't find it so start searching from the top
for (index = 0; index < startIndex; ++index)
{
if (GetRevision(index).MatchesSearchString(searchString))
return index;
}
return null;
}