private float getLocationLongitude(string cityName)
        {
            float locationLongitude;

            string response = getResponse(accuWeatherAPIEndpoint.getLocationEndpoint(cityName));

            System.Diagnostics.Debug.WriteLine(response);

            using (JsonParser <List <AccuWeatherAPILocationModel> > jsonParser = new JsonParser <List <AccuWeatherAPILocationModel> >())
            {
                List <AccuWeatherAPILocationModel> accuWeatherModel = new List <AccuWeatherAPILocationModel>();
                accuWeatherModel  = jsonParser.parse(response);
                locationLongitude = accuWeatherModel[0].GeoPosition.Longitude;
            }

            return(locationLongitude);
        }
Exemplo n.º 2
0
        private string getLocationKey(string cityName)
        {
            string locationKey = string.Empty;

            string response = getResponse(accuWeatherAPIEndpoint.getLocationEndpoint(cityName));

            System.Diagnostics.Debug.WriteLine(response);

            using (JsonParser <List <AccuWeatherAPILocationModel> > jsonParser = new JsonParser <List <AccuWeatherAPILocationModel> >())
            {
                List <AccuWeatherAPILocationModel> accuWeatherModel = new List <AccuWeatherAPILocationModel>();
                accuWeatherModel = jsonParser.parse(response, netCoreVersion);

                locationKey = accuWeatherModel[0].Key;
            }

            return(locationKey);
        }