private Clouds CreateClouds(IXmlService xmlService, XElement w) { Clouds clouds = new Clouds() { Value = xmlService.GetXmlAttributeText(w, "clouds", "value"), Unit = xmlService.GetXmlAttributeText(w, "clouds", "unit"), All = xmlService.GetXmlAttributeValue(w, "clouds", "all"), }; if ( string.IsNullOrEmpty(clouds.Value) && string.IsNullOrEmpty(clouds.Unit) && clouds.All == 0) { return null; } else { return clouds; } }
private Wind CreateWind(IXmlService xmlService, XElement w) { Wind wind = new Wind() { Direction = xmlService.GetXmlAttributeText(w, "windDirection", "name"), DirectionCode = xmlService.GetXmlAttributeText(w, "windDirection", "code"), Deg = xmlService.GetXmlAttributeText(w, "windDirection", "deg"), SpeedName = xmlService.GetXmlAttributeText(w, "windSpeed", "name"), Mps = xmlService.GetXmlAttributeValue(w, "windSpeed", "mps") }; if (string.IsNullOrEmpty(wind.Direction) && string.IsNullOrEmpty(wind.DirectionCode) && string.IsNullOrEmpty(wind.SpeedName) && string.IsNullOrEmpty(wind.Deg) && wind.Mps == 0) { return null; } else { return wind; } }
private Precipitation CreatePrecipitation(IXmlService xmlService, XElement w) { Precipitation precipitation = new Precipitation() { Value = xmlService.GetXmlAttributeValue(w, "precipitation", "value"), _Type = xmlService.GetXmlAttributeText(w, "precipitation", "type") }; if (precipitation.Value == 0 && string.IsNullOrEmpty(precipitation._Type)) { return null; } else { return precipitation; } }
private Pressure CreatePressure(IXmlService xmlService, XElement w) { Pressure pressure = new Pressure() { Value = xmlService.GetXmlAttributeValue(w, "pressure", "value"), Unit = xmlService.GetXmlAttributeText(w, "pressure", "unit") }; if (pressure.Value == 0 && string.IsNullOrEmpty(pressure.Unit)) { return null; } else { return pressure; } }
private Humidity CreateHumidity(IXmlService xmlService, XElement w) { Humidity humidity = new Humidity() { Value = xmlService.GetXmlAttributeValue(w, "humidity", "value"), Unit = xmlService.GetXmlAttributeText(w, "humidity", "unit") }; if (humidity.Value == 0 && string.IsNullOrEmpty(humidity.Unit)) { return null; } else { return humidity; } }