private static WeatherWeek ProcessWeeksWeatherData(WeeksWeatherData daysData) { WeatherWeek week = new WeatherWeek(DateTime.Now) { //Store tomorrow's date as 'long date' format: "Thursday, 10 April 2008" StartDate = DateTime.Today.ToString("D"), EndDate = DateTime.Today.AddDays(5).ToString("D") }; //Iterate through all weather data retrieved and create BasicWeather objects for (int i = 1; i < daysData.cnt; i++) { DateTime date = UnixTimeStampToDateTime(daysData.list[i].dt); //If the current result is for today, process it and store it in today if (ValidTimeToday(date)) { WeatherWeekDay weather = new WeatherWeekDay() { HighTemperature = daysData.list[i].temp.max, LowTemperature = daysData.list[i].temp.min, IconId = daysData.list[i].weather[0].icon, WeatherType = daysData.list[i].weather[0].main, }; week.AddDay(weather); } } return(week); }
public void InsertDay(int day, int high, int low, string weatherType, string iconID) { WeatherWeekDay dayOfWeek = new WeatherWeekDay() { HighTemperature = high, LowTemperature = low, WeatherType = weatherType, IconId = iconID }; WeatherDays[day] = dayOfWeek; }
public void AddDay(WeatherWeekDay day) { WeatherDays.Add(day); }
public void InsertDay(int day, WeatherWeekDay dayOfWeek) { WeatherDays[day] = dayOfWeek; }