static void Main(string[] args) { var weatherStation = new WeatherStation(); var currentConditionDisplay = new CurrentConditionsDisplay(); currentConditionDisplay.Subscribe(weatherStation); var forecastDisplay = new ForecastDisplay(); forecastDisplay.Subscribe(weatherStation); var statisticsDisplay = new StatisticsDisplay(); statisticsDisplay.Subscribe(weatherStation); var heatIndexDisplay = new HeatIndexDisplay(); heatIndexDisplay.Subscribe(weatherStation); weatherStation.TrackWeather(new WeatherData(80, 65, 30.4f)); weatherStation.TrackWeather(new WeatherData(82, 70, 29.2f)); weatherStation.TrackWeather(new WeatherData(78, 90, 29.2f)); Console.WriteLine(); weatherStation.EndTransmission(); }
static void Main(string[] args) { WeatherData weatherData = new WeatherData(); CurrentConditionsDisplay current = new CurrentConditionsDisplay(weatherData); weatherData.setMeasurements(80, 65, 30.4f); weatherData.setMeasurements(82, 70, 39.2f); }
static void Main(string[] args) { var weatherData = new WeatherData(); var currentDisplay = new CurrentConditionsDisplay(weatherData); weatherData.SetMeasurements(80, 65, 30.4f); weatherData.SetMeasurements(82, 70, 29.2f); weatherData.SetMeasurements(78, 90, 29.2f); }
static void Main(string[] args) { WeatherData weatherData = new WeatherData(); CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData); StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData); ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData); HeatIndexDisplay heatIndexDisplay = new HeatIndexDisplay(weatherData); weatherData.SetMeasurements(80, 65, 30.4f); weatherData.SetMeasurements(82, 70, 29.2f); weatherData.SetMeasurements(78, 90, 29.2f); }
public void Run() { WeatherData wd = new WeatherData(); CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(wd); StatisticsDisplay statisticsDisplay = new StatisticsDisplay(wd); ForecastDisplay forecastDisplay = new ForecastDisplay(wd); HeatIndexDisplay heheatDisplay = new HeatIndexDisplay(wd); wd.UpdateMeasurements(80, 65, 30.4f); wd.UpdateMeasurements(82, 70, 29.2f); wd.UpdateMeasurements(78, 90, 29.2f); }
static void Main(string[] args) { var weatherData = new WeatherData(); var currentDisplay = new CurrentConditionsDisplay(weatherData); var staticsDisplay = new StaticsDisplay(weatherData); var forecastDisplay = new ForecastDisplay(weatherData); weatherData.SetMeasurements(80, 65, 30.4); weatherData.SetMeasurements(82, 70, 29.2); weatherData.SetMeasurements(78, 90, 29.2); Console.ReadKey(); }
public static void Main() { WeatherData weatherData = new WeatherData(); CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData); StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData); ForcastDisplay forcastDisplay = new ForcastDisplay(weatherData); HeatIndexDisplay heatIndexDisplay = new HeatIndexDisplay(weatherData); Console.WriteLine("The Weather Station App..."); weatherData.SetMeasurements(80, 65, 30.4f); weatherData.SetMeasurements(82, 70, 29.2f); weatherData.SetMeasurements(78, 90, 29.2f); Console.ReadLine(); }
static void Main(string[] args) { // Erzeuge Publisher: WeatherData weatherData = new WeatherData(); // Erzeuge Anzeige: CurrentConditionsDisplay currentDisplay = new CurrentConditionsDisplay(weatherData); // Simuliere die Verfügbarkeit neuer Meswerte: weatherData.setMeasurements(15.0f, 44.2f, 1020.0f); weatherData.setMeasurements(16.5f, 48.9f, 1015.0f); weatherData.setMeasurements(16.2f, 47.3f, 1025.0f); // Halte Konsolenfenster offen: ReadLine(); } // Main.
private static void DoWork() { WeatherProvider weatherProvider = new WeatherProvider(); CurrentConditionsDisplay currentDisplay = new CurrentConditionsDisplay(); ForecastDisplay forecastDisplay = new ForecastDisplay(); StatisticsDisplay statisticsDisplay = new StatisticsDisplay(); HeatIndexDisplay heatIndexDisplay = new HeatIndexDisplay(); currentDisplay.Subscribe(weatherProvider); forecastDisplay.Subscribe(weatherProvider); statisticsDisplay.Subscribe(weatherProvider); heatIndexDisplay.Subscribe(weatherProvider); weatherProvider.SetMeasurements(80, 65, 30.4f); weatherProvider.SetMeasurements(82, 70, 29.2f); weatherProvider.SetMeasurements(78, 90, 29.2f); weatherProvider.EndService(); }
static void Main() { WeatherData weatherData = new WeatherData(); CurrentConditionsDisplay currentDisplay = new CurrentConditionsDisplay(weatherData); StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData); ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData); weatherData.SetMeasurements(80, 65, 30.4f); Console.WriteLine("++++++++++++++++++++++"); weatherData.SetMeasurements(82, 70, 29.2f); Console.WriteLine("++++++++++++++++++++++"); weatherData.SetMeasurements(78, 90, 29.2f); //currentDisplay.Display(); //Console.WriteLine("======================="); //statisticsDisplay.Display(); //Console.WriteLine("======================="); //forecastDisplay.Display(); //Console.WriteLine("======================="); }
static void Main(string[] args) { WeatherData weatherData = new WeatherData(); CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(); StatisticsDisplay statisticsDisplay = new StatisticsDisplay(); weatherData.RegisterObserver(currentConditionsDisplay); weatherData.RegisterObserver(statisticsDisplay); weatherData.MeasurementsChanged(); currentConditionsDisplay.Display(); statisticsDisplay.Display(); weatherData.MeasurementsChanged(); currentConditionsDisplay.Display(); statisticsDisplay.Display(); Console.ReadKey(); }