示例#1
0
 public Iterator(MyCollection myCollection)
 {
     _myCollection = myCollection;
 }
 public MyEnumerator(MyCollection collection)
 {
     this.collection = collection;
 }
示例#3
0
        public void TestA()
        {
            var mycoll = new MyCollection(new[] { 1, 2, 3 }, new[] { 12, 13, 14 }, new[] { 23, 24, 25 });
            var iterator1 = mycoll.GetIterator();
            var iterator2 = mycoll.GetIterator();

            iterator1.Next();
            iterator1.Next();
            iterator1.Next();

            iterator2.Next();
            iterator2.Next();

            var curr1 = iterator1.Current(); //12
            var curr2 = iterator2.Current(); //3
        }