/// <summary>Reports about current condition.</summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="WeatherDataChangedEventArgs"/> instance containing the event data.</param> public void Report(object sender, WeatherDataChangedEventArgs args) { this.Temperature = args.NewTemperature; this.Humidity = args.NewHumidity; this.Pressure = args.NewPressure; Console.WriteLine($"Current temperature is {this.Temperature} degrees celsius."); Console.WriteLine($"Current humidity is {this.Humidity} percent."); Console.WriteLine($"Current pressure is {this.Pressure} kPa."); Console.WriteLine("-----------------------------------------------------------"); }
/// <summary>Adds the data.</summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="WeatherDataChangedEventArgs"/> instance containing the event data.</param> public void AddData(object sender, WeatherDataChangedEventArgs args) { this.temperatureList.Add(args.NewTemperature); this.humidityList.Add(args.NewHumidity); this.pressureList.Add(args.NewPressure); }