//constructor sets default subject and output
        public WeatherDisplay(IWeatherSubject subject, ListBox output)
        {
            this.output = output;

            //adds observer to monitor
            subject.AddObserver(this);

            //sets values to 0
            currentHumidity = 0;
            currentPressure = 0;
            currentTemp     = 0;
        }
        //constructor sets default subject and output
        public WeatherDisplay(IWeatherSubject subject, ListBox output)
        {
            this.output = output;

            //adds observer to monitor
            subject.AddObserver(this);

            //sets values to 0
            currentHumidity = 0;
            currentPressure = 0;
            currentTemp = 0;
        }
        public WeatherMonitoringObserver(ListBox displayListBox, IWeatherSubject weatherSubject)
        {
            this.displayListBox = displayListBox;

            currtemp = 0;
            currhumidity = 0;
            currbaroPressure = 0;
            currcomputedtemp = 0;
            currcomputedhumidity = 0;
            currcomputedbaroPressure = 0;

            weatherSubject.addWeatherObserver(this);
        }
        public WeatherMonitoringObserver(ListBox displayListBox, IWeatherSubject weatherSubject)
        {
            this.displayListBox = displayListBox;

            currtemp                 = 0;
            currhumidity             = 0;
            currbaroPressure         = 0;
            currcomputedtemp         = 0;
            currcomputedhumidity     = 0;
            currcomputedbaroPressure = 0;

            weatherSubject.addWeatherObserver(this);
        }
示例#5
0
 public ForecastDisplay(IWeatherSubject ws)
 {
     this._weatherData = ws;
     this._weatherData.Register(this);
 }
 public CurrentConditionsDisplay(IWeatherSubject ws)
 {
     this._weatherData = ws;
     this._weatherData.Register(this);
 }
示例#7
0
 public CurrentConditionsDisplay(IWeatherSubject weatherData)
 {
     this.weatherData = weatherData;
     weatherData.RegisterObserver(this);
 }
 public HeatIndexDisplay(IWeatherSubject weatherSubject)
 {
     weatherSubject.RegisterObserver(this);
 }
 public CurrentConditionDisplay(IWeatherSubject weatherSubject)
 {
     _weatherSubject = weatherSubject;
     weatherSubject.RegisterObserver(this);
 }
 public DisplayForecast(IWeatherSubject subject, ListBox output)
     : base(subject, output)
 {
 }
 public DisplayAverage(IWeatherSubject subject, ListBox output)
     : base(subject, output)
 {
 }
 public DisplayForecast(IWeatherSubject subject, ListBox output)
     : base(subject, output)
 {
 }
 public HeatIndexDisplay(IWeatherSubject weatherSubject)
 {
     weatherSubject.RegisterObserver(this);
 }
 public DisplayTemperature(IWeatherSubject subject, ListBox output)
     : base(subject, output)
 {
 }
示例#15
0
 public StatisticsDisplay(IWeatherSubject ws)
 {
     this._weatherData = ws;
     this._weatherData.Register(this);
 }
示例#16
0
 public DisplayAverage(IWeatherSubject subject, ListBox output)
     : base(subject, output)
 {
 }
 public ForecastDisplay(IWeatherSubject weatherSubject)
 {
     weatherSubject.RegisterObserver(this);
 }
 public WeatherObserver(IWeatherSubject weatherSubject)
 {
     measurements = new Measurements();
     weatherSubject.AddObserver(this);
 }
 public DisplayTemperature(IWeatherSubject subject, ListBox output)
     : base(subject, output)
 {
 }
 public ForecastDisplay(IWeatherSubject weatherSubject)
 {
     weatherSubject.RegisterObserver(this);
 }
 public CurrentConditionDisplay(IWeatherSubject weatherSubject)
 {
     _weatherSubject = weatherSubject;
     weatherSubject.RegisterObserver(this);
 }