public static void Run() { var collection = new EnumerableCollection(); collection.Add("Edison"); collection.Add("Russel"); var iterator = collection.GetIterator(); for (var item = iterator.GetFirst(); !iterator.IsDone; item = iterator.GetNext()) { Console.WriteLine(item); } }
public CollectionIterator(EnumerableCollection collection) { _collection = collection; }