示例#1
0
            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;
                }
            }
示例#2
0
 public object Current()
 {
     return(_collection.GetItems()[_position]);
 }