예제 #1
0
 public string storeLocationForecast(string cityName)
 {
     if (!isCityStored(cityName))
     {
         LocationForecast lf = mapper.getLocationForecast(cityName);
         cityName = lf.Name.ToLower();
         locationForecast.Add(cityName, lf);
     }
     return(cityName);
 }
예제 #2
0
        public List <LocationDailyWeather> getFirstFivePrognosis(string cityName)
        {
            int cnt = 0;
            List <LocationDailyWeather> firstFive = new List <LocationDailyWeather>();

            currentCityForecast = mapper.getLocationForecast(cityName);
            foreach (LocationDailyWeather ldw in currentCityForecast.ForecastDict.Values)
            {
                if (cnt == 5)
                {
                    break;
                }
                ldw.loadIcon();
                firstFive.Add(ldw);
                cnt++;
            }
            return(firstFive);
        }