Ejemplo n.º 1
0
        public static void Observer()
        {
            WeatherData weatherData = new WeatherData();

            CurrentConditionsDisplay currentDisplay =
                new CurrentConditionsDisplay(weatherData);
            // StatisticsDisplay staticsDisplay = new StatisticsDisplay(weatherData);
            // ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData);

            weatherData.setMeasurements(80, 65, 30.4f);
            weatherData.setMeasurements(82, 70, 29.2f);
            weatherData.setMeasurements(78, 90, 29.2f);
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var weatherHandler           = new WeatherHandler();
            var currentConditionsDisplay = new CurrentConditionsDisplay(weatherHandler);
            var statisticsDisplay        = new StatisticsDisplay(weatherHandler);

            weatherHandler.WeatherInfo = new WeatherInfo(5, 5);
            Console.WriteLine();
            weatherHandler.WeatherInfo = new WeatherInfo(10, 6);
            Console.WriteLine();
            weatherHandler.WeatherInfo = new WeatherInfo(4, 3);
            Console.WriteLine();

            Console.ReadLine();
        }