public void notifyObservers() { foreach (var o in _observers) { IObserver item = (IObserver)o; item.Update(temperature, humidity, pressure); } }
public void notifyObservers() { foreach (var item in observers) { IObserver observer = (IObserver)item; observer.Update(temperature, humidity, pressure); } }
public void AddObserver(IObserver o) { if (!_functions.ContainsKey(o)) { _functions[o] = (sender, args) => o.Update(); Notify += _functions[o]; } }
public void NotifyObservers() { for (int i = 0; i < observers.Count; i++) { IObserver observer = observers[i]; observer.Update(temperature, humidity, pressure); } }