Inheritance: IAggregate
Ejemplo n.º 1
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            Aggregate aggregate = new Aggregate();

            aggregate[0] = new User { UserID = 1, Name = "Bob" };
            aggregate[1] = new User { UserID = 2, Name = "Bill" };
            aggregate[2] = new User { UserID = 3, Name = "Tom" };
            aggregate[3] = new User { UserID = 4, Name = "Rob" };
            aggregate[4] = new User { UserID = 5, Name = "Dan" };

            IIterator iterator = aggregate.GetIterator();

            string s = iterator.First.Name;
            while (!iterator.IsDone)
            {
                User user = iterator.Next;
                if (user != null)
                {
                    s += ", " + user.Name;
                }
            }
            lblUsers.Text = s;

        }
Ejemplo n.º 2
0
 public ConcreteIterator(Aggregate aggregate)
 {
     this._aggregate = aggregate;
 }
Ejemplo n.º 3
0
 public Iterator(Aggregate aggregate)
 {
     this.aggregate = aggregate;
 }
 public ConcreteIteratorShort(Aggregate agg)
 {
     aggregate = agg;
 }
Ejemplo n.º 5
0
 public ConcreteIterator(Aggregate aggregate)
 {
     this.aggregate = aggregate;
 }
Ejemplo n.º 6
0
 public NonZeroIterator(Aggregate <T> aggregate) : base(aggregate)
 {
 }