示例#1
0
        // Десериализация.
        private WeatherResponce SetWeatherResponce(string weather)
        {
            if (!TestForNullOrEmpty(weather))
            {
                weatherResponce = JsonConvert.DeserializeObject<WeatherResponce>(weather);
            }

            return weatherResponce;
        }
示例#2
0
        /// <summary>
        /// Поверка на NULL.
        /// </summary>
       private bool IsNullWeather(WeatherResponce weatherResponce)
        {
            if (weatherResponce == null)
            {
                return true;
            }

            if(weatherResponce.Main == null && weatherResponce.Sys == null)
            {
                return true;
            }

            return false;
        }