Beispiel #1
0
        static void Main(string[] args)
        {
            WeatherData             weatherData             = new WeatherData();
            StatisticReport         statisticReport         = new StatisticReport();
            ForeCastReport          foreCastReport          = new ForeCastReport();
            CurrentConditionsReport currentConditionsReport = new CurrentConditionsReport();

            statisticReport.Register(weatherData);
            foreCastReport.Register(weatherData);
            currentConditionsReport.Register(weatherData);

            weatherData.MeasurementsChange(12, 32, 44);
        }
        static void Main(string[] args)
        {
            WeatherData weatherData             = new WeatherData();
            var         currentConditionsReport = new CurrentConditionsReport();

            currentConditionsReport.Register(weatherData);
            weatherData.MeasurementsChange(30, 232, 12);
            var statisticRepost = new StatisticReport();
            var foreCastReport  = new ForeCastReport();

            statisticRepost.Register(weatherData);
            foreCastReport.Register(weatherData);
            weatherData.MeasurementsChange(12, 23, 567);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            WeatherInfo             weatherInfo = new WeatherInfo();
            CurrentConditionsReport report1     = new CurrentConditionsReport();

            report1.Register(weatherInfo);
            StatisticReport report2 = new StatisticReport();

            report2.Register(weatherInfo);
            ForeCastReport report3 = new ForeCastReport();

            report3.Register(weatherInfo);
            weatherInfo.NewDay(12, 23, 567);
            weatherInfo.NewDay(18, 80, 357);
            weatherInfo.NewDay(18, 96, 357);

            report1.Unregister(weatherInfo);
            report2.Unregister(weatherInfo);
            report3.Unregister(weatherInfo);
        }