Beispiel #1
0
 public static Iterator CreateIterator(CollectionList collection)
 {
     if (instance == null)
     {
         instance = new Iterator(collection);
     }
     return(instance);
 }
Beispiel #2
0
        private void IteratorApp_Load(object sender, EventArgs e)
        {
            CollectionList colection = new CollectionList();

            for (int i = 0; i <= 10; i++)
            {
                Item item = new Item("Item #" + Convert.ToString(i));
                colection.Add(item);
            }
            iterator = Iterator.CreateIterator(colection);

            txt_Item.Text = iterator.First().Name;
        }
Beispiel #3
0
 private Iterator(CollectionList collection)
 {
     this.collection = collection;
 }