Esempio n. 1
0
 public LocationInfo GetLocationInfo()
 {
     if (Resolver == null)
     {
         return(Location as LocationInfo);
     }
     return(Resolver.ResolveLocation(Location));
 }
Esempio n. 2
0
        /// <summary>
        /// Try to resolve location query, if it was successful, create forecastviewmodel for each forecast downloader and inject that forecast downloader through constructor
        /// </summary>
        private async void InitializeForecastsDownloads()
        {
            //resolve location query into coordinates
            var coordinates = await locationResolver.ResolveLocation(LocationQuery);

            //check if resolving was successful
            if (coordinates.Latitude is null || coordinates.Latitude is null)
            {
                return;
            }
            //clean forecastcollection
            ForecastsCollection = new ObservableCollection <IForecastViewModel>();
            //create forecastviewmodel for each forecast downloader and inject that downloader
            foreach (var forecastDownloader in forecastDownloaders)
            {
                forecastsCollection.Add(new ForecastViewModel(forecastDownloader, coordinates));
            }
        }
Esempio n. 3
0
 public LocationInfo GetLocationInfo(IProjectEntry project)
 {
     return(Resolver.ResolveLocation(project, Location));
 }
Esempio n. 4
0
 public LocationInfo GetLocationInfo()
 {
     return(Resolver.ResolveLocation(Location));
 }