private void ValidateIndex() { if (index < 0 || index >= items.Count) throw new InvalidOperationException("Enumerator is before or after the collection."); }