Exemplo n.º 1
0
        public void RegisterObserver(IObserver observer)
        {
            Iterator iterator = CreateIterator();

            while (iterator.HasNext())
            {
                IQuackable quacker = (IQuackable)iterator.Next();
                quacker.RegisterObserver(observer);
            }
        }
Exemplo n.º 2
0
        public void RegisterObserver(IObserver observer)
        {
            DuckIterator iterator = new DuckIterator(ducks);

            while (iterator.HasNext())
            {
                IQuackable duck = (IQuackable)iterator.Next();
                duck.RegisterObserver(observer);
            }
        }
Exemplo n.º 3
0
        public void RegisterObserver(IObserver observer)
        {
            IEnumerator iterator = quackers.GetEnumerator();

            while (iterator.MoveNext())
            {
                IQuackable duck = (IQuackable)iterator.Current;
                duck.RegisterObserver(observer);
            }
        }
Exemplo n.º 4
0
        public void RegisterObserver(IObserver observer)
        {
            IEnumerator <IQuackable> enumerator = quackers.GetEnumerator();

            while (enumerator.MoveNext())
            {
                IQuackable quacker = enumerator.Current;
                quacker.RegisterObserver(observer);
            }
        }
Exemplo n.º 5
0
        public void RegisterObserver(IObserver observer)
        {
            // Паттерн итератор
            IEnumerator <IQuackable> iterator = quackers.GetEnumerator();

            while (iterator.MoveNext())
            {
                IQuackable quacker = iterator.Current;
                quacker.RegisterObserver(observer);
            }
        }
 public void RegisterObserver(IObserver observer)
 {
     _duck.RegisterObserver(observer);
 }
Exemplo n.º 7
0
 public void RegisterObserver(IQuackObserver observer)
 {
     duck.RegisterObserver(observer);
 }