public ForecastDisplay(WeatherData weatherData)
 {
     this.weatherData = weatherData;
     weatherData.RegisterObserver(this);
 }
Exemple #2
0
 //构造器需要weatheData对象(或主题)作为注册用。
 public StatisticsDisplay(WeatherData weatherData)
 {
     this.weatherData = weatherData;
     weatherData.RegisterObserver(this);
 }
Exemple #3
0
 public HeatIndexDisplay(WeatherData weatherData)
 {
     this.weatherData = weatherData;
     weatherData.RegisterObserver(this);
 }