public List <WeatherInfo> RequestData() { XmlDocument doc = WebClientHelper.RequestXMLData(webWeatherAddress, webWeatherParams); if (doc == null) { return(null); } XmlNodeList list = doc.SelectNodes("SiteRep/DV/Location/Period"); List <WeatherInfo> infoList = new List <WeatherInfo>(); foreach (XmlNode node in list) { string date = node.Attributes["value"].Value.Substring(0, 10); foreach (XmlNode childNode in node.ChildNodes) { WeatherInfo info = new WeatherInfo(); info.WindDirection = childNode.Attributes["D"].Value; if (childNode.Attributes["H"] != null) { info.ScreenRelativeHumidity = decimal.Parse(childNode.Attributes["H"].Value); } else { info.ScreenRelativeHumidity = 0; } if (childNode.Attributes["P"] != null) { info.Pressure = ushort.Parse(childNode.Attributes["P"].Value); } else { info.Pressure = 0; } info.WindSpeed = ushort.Parse(childNode.Attributes["S"].Value); if (childNode.Attributes["T"] != null) { info.Temperature = decimal.Parse(childNode.Attributes["T"].Value); } else { info.Temperature = 0; } if (childNode.Attributes["W"] != null) { info.WeatherType = ushort.Parse(childNode.Attributes["W"].Value); } if (childNode.Attributes["Pt"] != null) { info.PressureTendency = childNode.Attributes["Pt"].Value; } else { info.PressureTendency = String.Empty; } if (childNode.Attributes["Dp"] != null) { info.DewPoint = decimal.Parse(childNode.Attributes["Dp"].Value); } else { info.DewPoint = 0; } if (childNode.Attributes["G"] != null) { info.WindGust = ushort.Parse(childNode.Attributes["G"].Value); } info.LoggedDateTime = new DateTime(int.Parse(date.Substring(0, 4)), int.Parse(date.Substring(5, 2)), int.Parse(date.Substring(8, 2)), int.Parse(childNode.ChildNodes[0].Value) / 60, 0, 0); infoList.Add(info); } } return(infoList); }