Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            WeatherStation station = new WeatherStation();

            CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(station);
            StatisticsDisplay statisticsDisplay = new StatisticsDisplay(station);

            station.SetMeasurements(80, 65, new decimal(30.4));
            station.SetMeasurements(82, 70, new decimal(29.2));
            station.SetMeasurements(78, 90, new decimal(29.2));

            Console.ReadKey();
        }
 public CurrentConditionsDisplay(WeatherStation station)
 {
     _station = station;
     station.RegisterObserver(this);
 }
Ejemplo n.º 3
0
 public WeatherSimpleFactory()
 {
     _station = new WeatherStation();
 }
Ejemplo n.º 4
0
 public StatisticsDisplay(WeatherStation station)
 {
     _station = station;
     station.RegisterObserver(this);
 }