Exemple #1
0
 public void notifyObservers()
 {
     for (int i = 0; i < observers.Count; i++)
     {
         IObserver observer = (IObserver)observers[i];
         observer.update(temperature, humidity, pressure);
     }
 }
Exemple #2
0
        private void notify()
        {
            int size = observers.Count;

            foreach (int index in Enumerable.Range(0, size))
            {
                IObserver o = (IObserver)observers[index];
                o.update(this);
            }
        }