public Dashboard(ISubject subject) { _subject = subject; _subject.RegisterObserver(this); // subscribe to event _subject.PriceThresholdAlertEvent += PriceAlert; }
public StatisticsDisplay(ISubject weatherDatasSubject) { Temperature = new List <float>(); Humidity = new List <float>(); Pressure = new List <float>(); WeatherDataSubject = weatherDatasSubject; weatherDatasSubject.RegisterObserver(this); }
public CurrentConditionsDisplay(ISubject weatherDataSubject) { WeatherData = weatherDataSubject; weatherDataSubject.RegisterObserver(this); }
public ForecastDisplay(ISubject weatherData) { weatherData.RegisterObserver(this); }
public CurrentConditionsDisplay(ISubject weatherData) { this.weatherData = weatherData; weatherData.RegisterObserver(this); }
public StatisticsDisplay(ISubject weatherData) { _weatherData = weatherData; weatherData.RegisterObserver(this); }
public Observer(string userName, ISubject subject) { UserName = userName; subject.RegisterObserver(this); }
public CurrentConditionsDisplay(ISubject weatherData) { weatherData.RegisterObserver(this); //subscribe itself, Subject(publisher) will add this instance to its list }
public HeatIndexDisplay(ISubject weatherData) { _weatherData = weatherData; _weatherData.RegisterObserver(this); }
public ForecastDisplay(ISubject weatherDatasuSubject) { WeatherDatasuSubject = weatherDatasuSubject; weatherDatasuSubject.RegisterObserver(this); }
public void AskRegistration() { _subject.RegisterObserver(this); Console.WriteLine("Signed up"); }
public HeatIndexDisplay(WeatherData weatherData) { this.weatherData = weatherData; weatherData.RegisterObserver(this); }