예제 #1
0
        static void Main(string[] args)
        {
            SampleContainer sc = new SampleContainer();

            foreach (Urun item in sc)
            {
                Console.WriteLine(item.UrunAdi);
                Console.WriteLine(item.UrunFiyat);
            }

            SampleIterator iter = (SampleIterator)sc.GetEnumerator();

            while (iter.MoveNext())
            {
                Console.WriteLine(((Urun)iter.Current).UrunAdi);
                Console.WriteLine(((Urun)iter.Current).UrunFiyat);
            }

            Console.ReadLine();
        }
예제 #2
0
 public SampleIterator(SampleContainer sc)
 {
     container = sc;
 }