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);
 }
Exemplo n.º 4
0
 public ForecastDisplay(ISubject weatherData)
 {
     weatherData.RegisterObserver(this);
 }
Exemplo n.º 5
0
 public CurrentConditionsDisplay(ISubject weatherData)
 {
     this.weatherData = weatherData;
     weatherData.RegisterObserver(this);
 }
Exemplo n.º 6
0
 public StatisticsDisplay(ISubject weatherData)
 {
     _weatherData = weatherData;
     weatherData.RegisterObserver(this);
 }
Exemplo n.º 7
0
 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
 }
Exemplo n.º 9
0
 public HeatIndexDisplay(ISubject weatherData)
 {
     _weatherData = weatherData;
     _weatherData.RegisterObserver(this);
 }
Exemplo n.º 10
0
 public ForecastDisplay(ISubject weatherDatasuSubject)
 {
     WeatherDatasuSubject = weatherDatasuSubject;
     weatherDatasuSubject.RegisterObserver(this);
 }
Exemplo n.º 11
0
 public void AskRegistration()
 {
     _subject.RegisterObserver(this);
     Console.WriteLine("Signed up");
 }
 public HeatIndexDisplay(WeatherData weatherData)
 {
     this.weatherData = weatherData;
     weatherData.RegisterObserver(this);
 }