private void ValidateIndex(int index, bool allowEqualEnd)
{
int max = (allowEqualEnd) ? (m_count) : (m_count - 1);
if (index < 0 || index > max)
throw new ArgumentOutOfRangeException(
"Index was out of range. Must be non-negative and less than the size of the collection.", index,
"Specified argument was out of the range of valid values.");
}