private static WeatherObject parceForecastMainWeather(WeatherObject weather, JObject obj) { var weatherJson = obj; WeatherMainInfo mainInfo = new WeatherMainInfo(); mainInfo.Pressure = (float)weatherJson["pressure"]; mainInfo.Humidity = (float)weatherJson["humidity"]; weatherJson = (JObject)obj["temp"]; mainInfo.Temp = (float)weatherJson["day"]; mainInfo.Temp_min = (float)weatherJson["min"]; mainInfo.Temp_max = (float)weatherJson["max"]; DayInfo dayInfo = new DayInfo(); dayInfo.Temp = (float)weatherJson["day"]; dayInfo.TempNight = (float)weatherJson["night"]; dayInfo.TempEve = (float)weatherJson["eve"]; dayInfo.TempMorn = (float)weatherJson["morn"]; weather.MainInfo = mainInfo; weather.DayInfo = dayInfo; return(parceWindWeather(weather, obj)); }
private static WeatherObject parceCurrentMainInfoWeather(WeatherObject weather, JObject obj) { var weatherJson = obj; WeatherMainInfo mainInfo = new WeatherMainInfo(); mainInfo.Temp = (float)weatherJson["temp"]; mainInfo.Pressure = (float)weatherJson["pressure"]; mainInfo.Humidity = (float)weatherJson["humidity"]; mainInfo.Temp_min = (float)weatherJson["temp_min"]; mainInfo.Temp_max = (float)weatherJson["temp_max"]; weather.MainInfo = mainInfo; return(weather); }