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