object IEnumerator.Current => Current(); // throw new NotImplementedException(); public AlphabeticalOrderIterator(WordsCollection collection, bool reverse = false) { _collection = collection; _reverse = reverse; // "_position" kommer antingen vara -1 eller antalet-element if (reverse) { _position = collection.GetItems().Count; } }
public object Current() { return(_collection.GetItems()[_position]); }