Пример #1
0
 public void NotifyObservers(WeatherData data)
 {
     foreach (var weatherObserver in observers)
     {
         weatherObserver.Update(data);
     }
 }
Пример #2
0
 public void Update(WeatherData data)
 {
     decimal current = data.Temperature;
     _temperatures.Add(current);
     if (current < _min) _min = current;
     if (current > _max) _max = current;
     Display();
 }
 public void Update(WeatherData data)
 {
     _temperature = data.Temperature;
     _humidity = data.Humidity;
     Display();
 }