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