예제 #1
0
        static void Main(string[] args)
        {
            var model = new WeatherDataModel();

            model.Subscribe(new DefaultDisplay());
            model.Subscribe(new StatisticDisplay());

            var data = new WeatherData();

            for (int i = 0; i < 10; i++)
            {
                model.Temperature        = data.GetTemperature();
                model.Humidity           = data.GetHumidity();
                model.BarometricPressure = data.GetBarometricPressure();
            }

            Console.ReadLine();
        }