public async Task <double> GetDistance() { var startPosition = new Position(Direction.FirstOrDefault().Latitude, Direction.FirstOrDefault().Longitude); var endPosition = new Position(Direction.LastOrDefault().Latitude, Direction.LastOrDefault().Longitude); return(GeoLocationService.GetDistance(startPosition, endPosition, Xamarin.Forms.GoogleMaps.DistanceType.Kilometers)); }
public ViewModelFactory( GeoLocationService locationService, TripLogDataService dataService) { _locationService = locationService; _dataService = dataService; }
/// <summary> /// Gets the geo location for a given address. /// </summary> /// <param name="user">The AdWords user.</param> /// <param name="address">The address for which geolocation should be /// fetched.</param> /// <returns>Geo location for the address.</returns> public GeoLocation GetLocationForAddress(AdWordsUser user, Address address) { GeoLocationService geoService = (GeoLocationService)user.GetService(AdWordsService.v201406.GeoLocationService); GeoLocationSelector selector = new GeoLocationSelector(); selector.addresses = new Address[] { address }; return(geoService.get(selector)[0]); }
public async override void OnNavigatedTo(object navigationParameter, Windows.UI.Xaml.Navigation.NavigationMode navigationMode, Dictionary <string, object> viewModelState) { MediaElement = new MediaElement() { IsMuted = true, IsLooping = true, AutoPlay = true, Stretch = Stretch.Uniform }; MediaElement.MediaFailed += (s, e) => ShowError(e.ErrorMessage); MediaElement.MediaOpened += (s, e) => CompleteLoad(); BitmapImage = new BitmapImage(); BitmapImage.ImageFailed += (s, e) => ShowError(e.ErrorMessage); BitmapImage.ImageOpened += (s, e) => CompleteLoad(); ResetUpload(); ChangeLocation(await GeoLocationService.GetCurrentLocation(PositionAccuracy.High)); }
public async Task GetFarthestDistance() { IGeoLocationService service = new GeoLocationService(); GeoLocationResult result = service.GetFarthestUsers(CreateMockUsers()); Assert.Equal("Vancouver", result.UserOne.Name); Assert.Equal("Toronto", result.UserTwo.Name); //Google says 3364 km //Searched "distance from vancouver to toronto by flight" //https://www.movable-type.co.uk/scripts/latlong.html says 3362 km with //Toronto : 43 39 3.8 N, 79 20 49.2 W //Vancouver : 49 14 46.6 N, 123 6 58.4 W Assert.Equal(3362, Math.Round(result.Distance)); }
}//OnNavigatedTo //Ref https://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapimage(v=vs.110).aspx // https://stackoverflow.com/questions/32314799/uwp-image-uri-in-application-folder public async void CurrentWeather() { try { var currentPosition = await GeoLocationService.GetPosition(); RootObject myWeather = await OpenWeatherMapService.GetWeather(currentPosition.Coordinate.Point.Position.Latitude, currentPosition.Coordinate.Point.Position.Longitude); //Set labels Label0.Text = "Location"; Label1.Text = "Description"; Label2.Text = "Temperature"; Label3.Text = "Wind Speed"; Label4.Text = "Sun Rise"; Label5.Text = "Sun Set"; //Display weather image string icon = String.Format("ms-appx:///Assets/Weather/{0}.png", myWeather.weather[0].icon); WeatherImage.Source = new BitmapImage(new Uri(icon, UriKind.Absolute)); //Display location LocationBlock.Text = myWeather.name; //Display weather description DescriptionBlock.Text = FirstCharToUpper(myWeather.weather[0].description); //Display temperature TemperatureBlock.Text = string.Format("{0}°C", myWeather.main.temp); //Display wind speed WindBlock.Text = string.Format("{0} m/s", myWeather.wind.speed); //Display time of sunrise and sunset var srTime = myMethods.getDate(myWeather.sys.sunrise); var ssTime = myMethods.getDate(myWeather.sys.sunset); var sunRise = srTime.ToString("H:mm"); var sunSet = ssTime.ToString("H:mm"); SunRiseBlock.Text = string.Format("{0}", sunRise); SunSetBlock.Text = string.Format("{0}", sunSet); } catch { WorldTidesStation.Text = "Error retrieving data"; myMethods.EnableGPSDialog(); } }//CurrentWeather
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var app = PropertyCrossApplication.GetApplication(this); app.CurrentActivity = this; var uiMarshal = new MarshalInvokeService(app); var source = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal)); geoLocationService = new GeoLocationService((Android.Locations.LocationManager)GetSystemService(Context.LocationService), uiMarshal); var stateService = new StatePersistenceService(app); PropertyCrossPersistentState state = stateService.LoadState(); SetContentView(Resource.Layout.PropertyCrossView); searchText = (EditText)FindViewById(Resource.Id.search); searchText.TextChanged += SearchText_Changed; searchText.SetOnEditorActionListener(this); myLocationButton = (Button)FindViewById(Resource.Id.use_location); myLocationButton.Click += LocationButton_Clicked; startSearchButton = (Button)FindViewById(Resource.Id.do_search); startSearchButton.Click += StartSearchButton_Clicked; messageText = (TextView)FindViewById(Resource.Id.mainview_message); resultsHeader = (TextView)FindViewById(Resource.Id.results_header); resultsList = (ListView)FindViewById(Resource.Id.results_list); resultsList.ItemClick += ResultsListItem_Clicked; resultsList.Adapter = new RecentSearchAdapter(this, new List <RecentSearch>()); loadingAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.loading_rotate); loadingAnimation.RepeatMode = RepeatMode.Restart; presenter = new PropertyCrossPresenter(state, source, new NavigationService(app), geoLocationService); presenter.SetView(this); app.Presenter = presenter; }
public async Task <WhereIAm> GetWhereIAm([FromServices] GeoLocationService geoLocation, string?any = null) { //TODO: what about // consider nullables being as Options, so that any nullable can be mapped // MapOrElse<T?, U>(this T? self, F<T,U> f, D<U> d); // var geo = await any.MapOrElseAsync(x=> geoLocation.GetLocation(IPAddress.Parse(any!)), () => geoLocation.GetLocation(HttpContext)); // also it does not shorter, but allows to fluent compose with other fluent ops like in rust (and has same API as Resul<T,E> we have) var geo = any != null ? await geoLocation.GetLocation(IPAddress.Parse(any !)) : await geoLocation.GetLocation(HttpContext); var remoteIpAddress = base.HttpContext.Connection.RemoteIpAddress?.ToString(); HttpContext.Request.Headers.TryGetValue("X-Forwarded-For", out var xForwardedFor); return(new WhereIAm { Geo = geo, RemoteIpAddress = remoteIpAddress, XForwardedFor = xForwardedFor, }); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var app = (PropertyFinderApplication)Application; app.CurrentActivity = this; var uiMarshal = new MarshalInvokeService(app); var source = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal)); geoLocationService = new GeoLocationService((LocationManager)GetSystemService(Context.LocationService), uiMarshal); var stateService = new StatePersistenceService(app); PropertyFinderPersistentState state = stateService.LoadState(); SetContentView(Resource.Layout.PropertyFinderView); searchText = (EditText)FindViewById(Resource.Id.search); searchText.TextChanged += SearchText_Changed; myLocationButton = (Button)FindViewById(Resource.Id.use_location); myLocationButton.Click += LocationButton_Clicked; startSearchButton = (Button)FindViewById(Resource.Id.do_search); startSearchButton.Click += StartSearchButton_Clicked; messageText = (TextView)FindViewById(Resource.Id.mainview_message); recentSearchList = (ListView)FindViewById(Resource.Id.recentsearches_list); recentSearchList.ItemClick += RecentSearchItem_Clicked; adapter = new RecentSearchAdapter(this, new List <RecentSearch>()); recentSearchList.Adapter = adapter; presenter = new PropertyFinderPresenter(state, source, new NavigationService(app), geoLocationService); presenter.SetView(this); app.Presenter = presenter; }
}//CurrentWeather public async void CurrentTidesExtreme() { try { var currentPosition = await GeoLocationService.GetPosition(); RootObjectExtreme myTides = await Model.WorldTidesExtremeService.GetMaxMinTides(currentPosition.Coordinate.Point.Position.Latitude, currentPosition.Coordinate.Point.Position.Longitude); //WorldTides JSON provides 7 high/low tides - only going to use 4 on this page, ideally 2 high & 2 low for the same day //Set variables for the time of high/low tides var tideTime = ""; var tide = myMethods.getDate(myTides.extremes[0].dt); var tide1 = myMethods.getDate(myTides.extremes[1].dt); var tide2 = myMethods.getDate(myTides.extremes[2].dt); var tide3 = myMethods.getDate(myTides.extremes[3].dt); //Display tide type - high/low TideTypeBlock.Text = myTides.extremes[0].type; TideTypeBlock1.Text = myTides.extremes[1].type; TideTypeBlock2.Text = myTides.extremes[2].type; TideTypeBlock3.Text = myTides.extremes[3].type; //Display the time of high/low tides tideTime = tide.ToString("dddd H:mm"); TideTimeBlock.Text = tideTime; tideTime = tide1.ToString("dddd H:mm"); TideTimeBlock1.Text = tideTime; tideTime = tide2.ToString("dddd H:mm"); TideTimeBlock2.Text = tideTime; tideTime = tide3.ToString("dddd H:mm"); TideTimeBlock3.Text = tideTime; //Display the station that retrieved worldtides data WorldTidesStation.Text = string.Format("WorldTides Station: {0}", myTides.station); }//Try catch { //Popup already displayed by currentWeather }//Catch }//CurrentTidesExtreme
// Constructor public TodoCollectionVM() { // Create new Model that you want to wrap in View Model // Model can have a data already in it or may call http services to obtain it Debug.WriteLine("Constructing VM"); todoCollection = new TodoCollection(); myGeoService = new GeoLocationService(); // create instance of Geo Service myGeoService.initialiseGeoLocation(); // initialise service, ask user for access Debug.WriteLine(myGeoService.Geo_status); _SelectedIndex = -1; // Set selected index in ListView to nothing. // This property has x:Bind to it's getter in ListView on Page // Loop over collection in Model and add each Todo task from it to a ViewModel (ObservableCollection) foreach (var task in todoCollection.TodoList) { var nt = new TaskTodoVM(task); // Note that ObservableCollection _TodoList // takes objects of type TaskTodoVM that is wrapping // POCO Model for Task on the List. // nt.PropertyChanged += Task_OnNotifyPropertyChanged; // _TodoList.Add(nt); } }
private void btnGPS_Clicked(object sender, EventArgs e) { var geo = new GeoLocationService().GetGeoLocation(); if (geo != null) { edtLatitude.Text = geo.Latitude.ToString(); edtLongitude.Text = geo.Longitude.ToString(); edtHeight.Text = geo.Height.ToString(); try { if (!string.IsNullOrEmpty(edtLatitude.Text) && !string.IsNullOrEmpty(edtLongitude.Text)) { double latitude = Double.Parse(edtLatitude.Text); double longitude = Double.Parse(edtLongitude.Text); var map = new Map(MapSpan.FromCenterAndRadius(new Xamarin.Forms.Maps.Position(latitude, longitude), Distance.FromKilometers(2))); var pin = new Pin() { Position = new Xamarin.Forms.Maps.Position(latitude, longitude), Label = "YOU" }; map.Pins.Add(pin); MapContent.Content = map; MapContent.IsVisible = true; } } catch (Exception ex) { slMsg.IsVisible = true; msg.Text = ex.Message.ToString(); MapContent.IsVisible = false; } } }
public IActionResult Location([FromBody] GeoLocationServiceRequest request) { if (request == null) { ServiceResponse response = new ServiceResponse { Success = false, Message = "No body provided" }; } else if (request.IPAddress == string.Empty) { ServiceResponse response = new ServiceResponse { Success = false, Message = "No IP Address provided" }; } else { GeoLocationService service = new GeoLocationService(Configuration); LocationModal locationModal = service.GetLocationByIPAddress(request.IPAddress); GeoLocationResponseResult geoLocationResponseResult = new GeoLocationResponseResult() { locationModal = locationModal, Success = true, Message = string.Empty }; return(Ok(geoLocationResponseResult)); } return(BadRequest("No response")); }
}//OnNavigatedTo public async void ForecastWeather() { try { var currentPosition = await GeoLocationService.GetPosition(); RootObject myForecast = await Model.OpenWeatherMapForecastService.GetForecast(currentPosition.Coordinate.Point.Position.Latitude, currentPosition.Coordinate.Point.Position.Longitude); //Set labels Label00.Text = "Wind:"; Label01.Text = "Wind:"; Label02.Text = "Wind:"; Label03.Text = "Wind:"; Label04.Text = "Wind:"; Label05.Text = "Wind:"; Label06.Text = "Wind:"; Label07.Text = "Wind:"; Label08.Text = "Wind:"; Label09.Text = "Wind:"; Label10.Text = "Wind:"; Label11.Text = "Wind:"; Label12.Text = "Wind:"; Label13.Text = "Wind:"; Label14.Text = "Wind:"; Label15.Text = "Wind:"; Label16.Text = "Wind:"; Label17.Text = "Wind:"; Label18.Text = "Wind:"; Label19.Text = "Wind:"; Label20.Text = "Wind:"; Label21.Text = "Wind:"; Label22.Text = "Wind:"; Label23.Text = "Wind:"; Label24.Text = "Wind:"; Label25.Text = "Wind:"; Label26.Text = "Wind:"; Label27.Text = "Wind:"; Label28.Text = "Wind:"; Label29.Text = "Wind:"; Label30.Text = "Wind:"; Label31.Text = "Wind:"; Label32.Text = "Wind:"; Label33.Text = "Wind:"; Label34.Text = "Wind:"; Label35.Text = "Wind:"; Label36.Text = "Wind:"; Label37.Text = "Wind:"; Label38.Text = "Wind:"; Label39.Text = "Clouds:"; Label40.Text = "Clouds:"; Label41.Text = "Clouds:"; Label42.Text = "Clouds:"; Label43.Text = "Clouds:"; Label44.Text = "Clouds:"; Label45.Text = "Clouds:"; Label46.Text = "Clouds:"; Label47.Text = "Clouds:"; Label48.Text = "Clouds:"; Label49.Text = "Clouds:"; Label50.Text = "Clouds:"; Label51.Text = "Clouds:"; Label52.Text = "Clouds:"; Label53.Text = "Clouds:"; Label54.Text = "Clouds:"; Label55.Text = "Clouds:"; Label56.Text = "Clouds:"; Label57.Text = "Clouds:"; Label58.Text = "Clouds:"; Label59.Text = "Clouds:"; Label60.Text = "Clouds:"; Label61.Text = "Clouds:"; Label62.Text = "Clouds:"; Label63.Text = "Clouds:"; Label64.Text = "Clouds:"; Label65.Text = "Clouds:"; Label66.Text = "Clouds:"; Label67.Text = "Clouds:"; Label68.Text = "Clouds:"; Label69.Text = "Clouds:"; Label70.Text = "Clouds:"; Label71.Text = "Clouds:"; Label72.Text = "Clouds:"; Label73.Text = "Clouds:"; Label74.Text = "Clouds:"; Label75.Text = "Clouds:"; Label76.Text = "Clouds:"; Label77.Text = "Clouds:"; //Clouds //Setting & displaying date var date0 = myMethods.getDate(myForecast.list[0].dt); var date0String = date0.ToString("ddd dd MMM"); Date0.Text = date0String; var date1 = myMethods.getDate(myForecast.list[1].dt); var date1String = date1.ToString("ddd dd MMM"); Date1.Text = date1String; var date2 = myMethods.getDate(myForecast.list[2].dt); var date2String = date2.ToString("ddd dd MMM"); Date2.Text = date2String; var date3 = myMethods.getDate(myForecast.list[3].dt); var date3String = date3.ToString("ddd dd MMM"); Date3.Text = date3String; var date4 = myMethods.getDate(myForecast.list[4].dt); var date4String = date4.ToString("ddd dd MMM"); Date4.Text = date4String; var date5 = myMethods.getDate(myForecast.list[5].dt); var date5String = date5.ToString("ddd dd MMM"); Date5.Text = date5String; var date6 = myMethods.getDate(myForecast.list[6].dt); var date6String = date6.ToString("ddd dd MMM"); Date6.Text = date6String; var date7 = myMethods.getDate(myForecast.list[7].dt); var date7String = date7.ToString("ddd dd MMM"); Date7.Text = date7String; var date8 = myMethods.getDate(myForecast.list[8].dt); var date8String = date8.ToString("ddd dd MMM"); Date8.Text = date8String; var date9 = myMethods.getDate(myForecast.list[9].dt); var date9String = date9.ToString("ddd dd MMM"); Date9.Text = date9String; var date10 = myMethods.getDate(myForecast.list[10].dt); var date10String = date10.ToString("ddd dd MMM"); Date10.Text = date10String; var date11 = myMethods.getDate(myForecast.list[11].dt); var date11String = date11.ToString("ddd dd MMM"); Date11.Text = date11String; var date12 = myMethods.getDate(myForecast.list[12].dt); var date12String = date12.ToString("ddd dd MMM"); Date12.Text = date12String; var date13 = myMethods.getDate(myForecast.list[13].dt); var date13String = date13.ToString("ddd dd MMM"); Date13.Text = date13String; var date14 = myMethods.getDate(myForecast.list[14].dt); var date14String = date14.ToString("ddd dd MMM"); Date14.Text = date14String; var date15 = myMethods.getDate(myForecast.list[15].dt); var date15String = date15.ToString("ddd dd MMM"); Date15.Text = date15String; var date16 = myMethods.getDate(myForecast.list[16].dt); var date16String = date16.ToString("ddd dd MMM"); Date16.Text = date16String; var date17 = myMethods.getDate(myForecast.list[17].dt); var date17String = date17.ToString("ddd dd MMM"); Date17.Text = date17String; var date18 = myMethods.getDate(myForecast.list[18].dt); var date18String = date18.ToString("ddd dd MMM"); Date18.Text = date18String; var date19 = myMethods.getDate(myForecast.list[19].dt); var date19String = date19.ToString("ddd dd MMM"); Date19.Text = date19String; var date20 = myMethods.getDate(myForecast.list[20].dt); var date20String = date20.ToString("ddd dd MMM"); Date20.Text = date20String; var date21 = myMethods.getDate(myForecast.list[21].dt); var date21String = date21.ToString("ddd dd MMM"); Date21.Text = date21String; var date22 = myMethods.getDate(myForecast.list[22].dt); var date22String = date22.ToString("ddd dd MMM"); Date22.Text = date22String; var date23 = myMethods.getDate(myForecast.list[23].dt); var date23String = date23.ToString("ddd dd MMM"); Date23.Text = date23String; var date24 = myMethods.getDate(myForecast.list[24].dt); var date24String = date24.ToString("ddd dd MMM"); Date24.Text = date24String; var date25 = myMethods.getDate(myForecast.list[25].dt); var date25String = date25.ToString("ddd dd MMM"); Date25.Text = date25String; var date26 = myMethods.getDate(myForecast.list[26].dt); var date26String = date26.ToString("ddd dd MMM"); Date26.Text = date26String; var date27 = myMethods.getDate(myForecast.list[27].dt); var date27String = date27.ToString("ddd dd MMM"); Date27.Text = date27String; var date28 = myMethods.getDate(myForecast.list[28].dt); var date28String = date28.ToString("ddd dd MMM"); Date28.Text = date28String; var date29 = myMethods.getDate(myForecast.list[29].dt); var date29String = date29.ToString("ddd dd MMM"); Date29.Text = date29String; var date30 = myMethods.getDate(myForecast.list[30].dt); var date30String = date30.ToString("ddd dd MMM"); Date30.Text = date30String; var date31 = myMethods.getDate(myForecast.list[31].dt); var date31String = date31.ToString("ddd dd MMM"); Date31.Text = date31String; var date32 = myMethods.getDate(myForecast.list[32].dt); var date32String = date32.ToString("ddd dd MMM"); Date32.Text = date32String; var date33 = myMethods.getDate(myForecast.list[33].dt); var date33String = date33.ToString("ddd dd MMM"); Date33.Text = date33String; var date34 = myMethods.getDate(myForecast.list[34].dt); var date34String = date34.ToString("ddd dd MMM"); Date34.Text = date34String; var date35 = myMethods.getDate(myForecast.list[35].dt); var date35String = date35.ToString("ddd dd MMM"); Date35.Text = date35String; var date36 = myMethods.getDate(myForecast.list[36].dt); var date36String = date36.ToString("ddd dd MMM"); Date36.Text = date36String; var date37 = myMethods.getDate(myForecast.list[37].dt); var date37String = date37.ToString("ddd dd MMM"); Date37.Text = date37String; var date38 = myMethods.getDate(myForecast.list[38].dt); var date38String = date38.ToString("ddd dd MMM"); Date38.Text = date38String; //Setting & displaying time var time0 = myMethods.getDate(myForecast.list[0].dt); var time0String = time0.ToString("t"); Time0.Text = time0String; var time1 = myMethods.getDate(myForecast.list[1].dt); var time1String = time1.ToString("t"); Time1.Text = time1String; var time2 = myMethods.getDate(myForecast.list[2].dt); var time2String = time2.ToString("t"); Time2.Text = time2String; var time3 = myMethods.getDate(myForecast.list[3].dt); var time3String = time3.ToString("t"); Time3.Text = time3String; var time4 = myMethods.getDate(myForecast.list[4].dt); var time4String = time4.ToString("t"); Time4.Text = time4String; var time5 = myMethods.getDate(myForecast.list[5].dt); var time5String = time5.ToString("t"); Time5.Text = time5String; var time6 = myMethods.getDate(myForecast.list[6].dt); var time6String = time6.ToString("t"); Time6.Text = time6String; var time7 = myMethods.getDate(myForecast.list[7].dt); var time7String = time7.ToString("t"); Time7.Text = time7String; var time8 = myMethods.getDate(myForecast.list[8].dt); var time8String = time8.ToString("t"); Time8.Text = time8String; var time9 = myMethods.getDate(myForecast.list[9].dt); var time9String = time9.ToString("t"); Time9.Text = time9String; var time10 = myMethods.getDate(myForecast.list[10].dt); var time10String = time10.ToString("t"); Time10.Text = time10String; var time11 = myMethods.getDate(myForecast.list[11].dt); var time11String = time11.ToString("t"); Time11.Text = time11String; var time12 = myMethods.getDate(myForecast.list[12].dt); var time12String = time12.ToString("t"); Time12.Text = time12String; var time13 = myMethods.getDate(myForecast.list[13].dt); var time13String = time13.ToString("t"); Time13.Text = time13String; var time14 = myMethods.getDate(myForecast.list[14].dt); var time14String = time14.ToString("t"); Time14.Text = time14String; var time15 = myMethods.getDate(myForecast.list[15].dt); var time15String = time15.ToString("t"); Time15.Text = time15String; var time16 = myMethods.getDate(myForecast.list[16].dt); var time16String = time16.ToString("t"); Time16.Text = time16String; var time17 = myMethods.getDate(myForecast.list[17].dt); var time17String = time17.ToString("t"); Time17.Text = time17String; var time18 = myMethods.getDate(myForecast.list[18].dt); var time18String = time18.ToString("t"); Time18.Text = time18String; var time19 = myMethods.getDate(myForecast.list[19].dt); var time19String = time19.ToString("t"); Time19.Text = time19String; var time20 = myMethods.getDate(myForecast.list[20].dt); var time20String = time20.ToString("t"); Time20.Text = time20String; var time21 = myMethods.getDate(myForecast.list[21].dt); var time21String = time21.ToString("t"); Time21.Text = time21String; var time22 = myMethods.getDate(myForecast.list[22].dt); var time22String = time22.ToString("t"); Time22.Text = time22String; var time23 = myMethods.getDate(myForecast.list[23].dt); var time23String = time23.ToString("t"); Time23.Text = time23String; var time24 = myMethods.getDate(myForecast.list[24].dt); var time24String = time24.ToString("t"); Time24.Text = time24String; var time25 = myMethods.getDate(myForecast.list[25].dt); var time25String = time25.ToString("t"); Time25.Text = time25String; var time26 = myMethods.getDate(myForecast.list[26].dt); var time26String = time26.ToString("t"); Time26.Text = time26String; var time27 = myMethods.getDate(myForecast.list[27].dt); var time27String = time27.ToString("t"); Time27.Text = time27String; var time28 = myMethods.getDate(myForecast.list[28].dt); var time28String = time28.ToString("t"); Time28.Text = time28String; var time29 = myMethods.getDate(myForecast.list[29].dt); var time29String = time29.ToString("t"); Time29.Text = time29String; var time30 = myMethods.getDate(myForecast.list[30].dt); var time30String = time30.ToString("t"); Time30.Text = time30String; var time31 = myMethods.getDate(myForecast.list[31].dt); var time31String = time31.ToString("t"); Time31.Text = time31String; var time32 = myMethods.getDate(myForecast.list[32].dt); var time32String = time32.ToString("t"); Time32.Text = time32String; var time33 = myMethods.getDate(myForecast.list[33].dt); var time33String = time33.ToString("t"); Time33.Text = time33String; var time34 = myMethods.getDate(myForecast.list[34].dt); var time34String = time34.ToString("t"); Time34.Text = time34String; var time35 = myMethods.getDate(myForecast.list[35].dt); var time35String = time35.ToString("t"); Time35.Text = time35String; var time36 = myMethods.getDate(myForecast.list[36].dt); var time36String = time36.ToString("t"); Time36.Text = time36String; var time37 = myMethods.getDate(myForecast.list[37].dt); var time37String = time37.ToString("t"); Time37.Text = time37String; var time38 = myMethods.getDate(myForecast.list[38].dt); var time38String = time38.ToString("t"); Time38.Text = time38String; //Setting images variables string icon0 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[0].weather[0].icon); string icon1 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[1].weather[0].icon); string icon2 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[2].weather[0].icon); string icon3 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[3].weather[0].icon); string icon4 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[4].weather[0].icon); string icon5 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[5].weather[0].icon); string icon6 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[6].weather[0].icon); string icon7 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[7].weather[0].icon); string icon8 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[8].weather[0].icon); string icon9 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[9].weather[0].icon); string icon10 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[10].weather[0].icon); string icon11 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[11].weather[0].icon); string icon12 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[12].weather[0].icon); string icon13 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[13].weather[0].icon); string icon14 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[14].weather[0].icon); string icon15 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[15].weather[0].icon); string icon16 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[16].weather[0].icon); string icon17 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[17].weather[0].icon); string icon18 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[18].weather[0].icon); string icon19 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[19].weather[0].icon); string icon20 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[20].weather[0].icon); string icon21 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[21].weather[0].icon); string icon22 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[22].weather[0].icon); string icon23 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[23].weather[0].icon); string icon24 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[24].weather[0].icon); string icon25 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[25].weather[0].icon); string icon26 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[26].weather[0].icon); string icon27 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[27].weather[0].icon); string icon28 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[28].weather[0].icon); string icon29 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[29].weather[0].icon); string icon30 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[30].weather[0].icon); string icon31 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[31].weather[0].icon); string icon32 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[32].weather[0].icon); string icon33 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[33].weather[0].icon); string icon34 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[34].weather[0].icon); string icon35 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[35].weather[0].icon); string icon36 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[36].weather[0].icon); string icon37 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[37].weather[0].icon); string icon38 = String.Format("ms-appx:///Assets/Weather/{0}.png", myForecast.list[38].weather[0].icon); //Displaying Images WeatherImage0.Source = new BitmapImage(new Uri(icon0, UriKind.Absolute)); WeatherImage1.Source = new BitmapImage(new Uri(icon1, UriKind.Absolute)); WeatherImage2.Source = new BitmapImage(new Uri(icon2, UriKind.Absolute)); WeatherImage3.Source = new BitmapImage(new Uri(icon3, UriKind.Absolute)); WeatherImage4.Source = new BitmapImage(new Uri(icon4, UriKind.Absolute)); WeatherImage5.Source = new BitmapImage(new Uri(icon5, UriKind.Absolute)); WeatherImage6.Source = new BitmapImage(new Uri(icon6, UriKind.Absolute)); WeatherImage7.Source = new BitmapImage(new Uri(icon7, UriKind.Absolute)); WeatherImage8.Source = new BitmapImage(new Uri(icon8, UriKind.Absolute)); WeatherImage9.Source = new BitmapImage(new Uri(icon9, UriKind.Absolute)); WeatherImage10.Source = new BitmapImage(new Uri(icon10, UriKind.Absolute)); WeatherImage11.Source = new BitmapImage(new Uri(icon11, UriKind.Absolute)); WeatherImage12.Source = new BitmapImage(new Uri(icon12, UriKind.Absolute)); WeatherImage13.Source = new BitmapImage(new Uri(icon13, UriKind.Absolute)); WeatherImage14.Source = new BitmapImage(new Uri(icon14, UriKind.Absolute)); WeatherImage15.Source = new BitmapImage(new Uri(icon15, UriKind.Absolute)); WeatherImage16.Source = new BitmapImage(new Uri(icon16, UriKind.Absolute)); WeatherImage17.Source = new BitmapImage(new Uri(icon17, UriKind.Absolute)); WeatherImage18.Source = new BitmapImage(new Uri(icon18, UriKind.Absolute)); WeatherImage19.Source = new BitmapImage(new Uri(icon19, UriKind.Absolute)); WeatherImage20.Source = new BitmapImage(new Uri(icon20, UriKind.Absolute)); WeatherImage21.Source = new BitmapImage(new Uri(icon21, UriKind.Absolute)); WeatherImage22.Source = new BitmapImage(new Uri(icon22, UriKind.Absolute)); WeatherImage23.Source = new BitmapImage(new Uri(icon23, UriKind.Absolute)); WeatherImage24.Source = new BitmapImage(new Uri(icon24, UriKind.Absolute)); WeatherImage25.Source = new BitmapImage(new Uri(icon25, UriKind.Absolute)); WeatherImage26.Source = new BitmapImage(new Uri(icon26, UriKind.Absolute)); WeatherImage27.Source = new BitmapImage(new Uri(icon27, UriKind.Absolute)); WeatherImage28.Source = new BitmapImage(new Uri(icon28, UriKind.Absolute)); WeatherImage29.Source = new BitmapImage(new Uri(icon29, UriKind.Absolute)); WeatherImage30.Source = new BitmapImage(new Uri(icon30, UriKind.Absolute)); WeatherImage31.Source = new BitmapImage(new Uri(icon31, UriKind.Absolute)); WeatherImage32.Source = new BitmapImage(new Uri(icon32, UriKind.Absolute)); WeatherImage33.Source = new BitmapImage(new Uri(icon33, UriKind.Absolute)); WeatherImage34.Source = new BitmapImage(new Uri(icon34, UriKind.Absolute)); WeatherImage35.Source = new BitmapImage(new Uri(icon35, UriKind.Absolute)); WeatherImage36.Source = new BitmapImage(new Uri(icon36, UriKind.Absolute)); WeatherImage37.Source = new BitmapImage(new Uri(icon37, UriKind.Absolute)); WeatherImage38.Source = new BitmapImage(new Uri(icon38, UriKind.Absolute)); //Displaying max temp MaxTemp0.Text = string.Format("{0}°C", myForecast.list[0].main.temp_max); MaxTemp1.Text = string.Format("{0}°C", myForecast.list[1].main.temp_max); MaxTemp2.Text = string.Format("{0}°C", myForecast.list[2].main.temp_max); MaxTemp3.Text = string.Format("{0}°C", myForecast.list[3].main.temp_max); MaxTemp4.Text = string.Format("{0}°C", myForecast.list[4].main.temp_max); MaxTemp5.Text = string.Format("{0}°C", myForecast.list[5].main.temp_max); MaxTemp6.Text = string.Format("{0}°C", myForecast.list[6].main.temp_max); MaxTemp7.Text = string.Format("{0}°C", myForecast.list[7].main.temp_max); MaxTemp8.Text = string.Format("{0}°C", myForecast.list[8].main.temp_max); MaxTemp9.Text = string.Format("{0}°C", myForecast.list[9].main.temp_max); MaxTemp10.Text = string.Format("{0}°C", myForecast.list[10].main.temp_max); MaxTemp11.Text = string.Format("{0}°C", myForecast.list[11].main.temp_max); MaxTemp12.Text = string.Format("{0}°C", myForecast.list[12].main.temp_max); MaxTemp13.Text = string.Format("{0}°C", myForecast.list[13].main.temp_max); MaxTemp14.Text = string.Format("{0}°C", myForecast.list[14].main.temp_max); MaxTemp15.Text = string.Format("{0}°C", myForecast.list[15].main.temp_max); MaxTemp16.Text = string.Format("{0}°C", myForecast.list[16].main.temp_max); MaxTemp17.Text = string.Format("{0}°C", myForecast.list[17].main.temp_max); MaxTemp18.Text = string.Format("{0}°C", myForecast.list[18].main.temp_max); MaxTemp19.Text = string.Format("{0}°C", myForecast.list[19].main.temp_max); MaxTemp20.Text = string.Format("{0}°C", myForecast.list[20].main.temp_max); MaxTemp21.Text = string.Format("{0}°C", myForecast.list[21].main.temp_max); MaxTemp22.Text = string.Format("{0}°C", myForecast.list[22].main.temp_max); MaxTemp23.Text = string.Format("{0}°C", myForecast.list[23].main.temp_max); MaxTemp24.Text = string.Format("{0}°C", myForecast.list[24].main.temp_max); MaxTemp25.Text = string.Format("{0}°C", myForecast.list[25].main.temp_max); MaxTemp26.Text = string.Format("{0}°C", myForecast.list[26].main.temp_max); MaxTemp27.Text = string.Format("{0}°C", myForecast.list[27].main.temp_max); MaxTemp28.Text = string.Format("{0}°C", myForecast.list[28].main.temp_max); MaxTemp29.Text = string.Format("{0}°C", myForecast.list[29].main.temp_max); MaxTemp30.Text = string.Format("{0}°C", myForecast.list[30].main.temp_max); MaxTemp31.Text = string.Format("{0}°C", myForecast.list[31].main.temp_max); MaxTemp32.Text = string.Format("{0}°C", myForecast.list[32].main.temp_max); MaxTemp33.Text = string.Format("{0}°C", myForecast.list[33].main.temp_max); MaxTemp34.Text = string.Format("{0}°C", myForecast.list[34].main.temp_max); MaxTemp35.Text = string.Format("{0}°C", myForecast.list[35].main.temp_max); MaxTemp36.Text = string.Format("{0}°C", myForecast.list[36].main.temp_max); MaxTemp37.Text = string.Format("{0}°C", myForecast.list[37].main.temp_max); MaxTemp38.Text = string.Format("{0}°C", myForecast.list[38].main.temp_max); //Displaying min temp MinTemp0.Text = string.Format("{0}°C", myForecast.list[0].main.temp_min); MinTemp1.Text = string.Format("{0}°C", myForecast.list[1].main.temp_min); MinTemp2.Text = string.Format("{0}°C", myForecast.list[2].main.temp_min); MinTemp3.Text = string.Format("{0}°C", myForecast.list[3].main.temp_min); MinTemp4.Text = string.Format("{0}°C", myForecast.list[4].main.temp_min); MinTemp5.Text = string.Format("{0}°C", myForecast.list[5].main.temp_min); MinTemp6.Text = string.Format("{0}°C", myForecast.list[6].main.temp_min); MinTemp7.Text = string.Format("{0}°C", myForecast.list[7].main.temp_min); MinTemp8.Text = string.Format("{0}°C", myForecast.list[8].main.temp_min); MinTemp9.Text = string.Format("{0}°C", myForecast.list[9].main.temp_min); MinTemp10.Text = string.Format("{0}°C", myForecast.list[10].main.temp_min); MinTemp11.Text = string.Format("{0}°C", myForecast.list[11].main.temp_min); MinTemp12.Text = string.Format("{0}°C", myForecast.list[12].main.temp_min); MinTemp13.Text = string.Format("{0}°C", myForecast.list[13].main.temp_min); MinTemp14.Text = string.Format("{0}°C", myForecast.list[14].main.temp_min); MinTemp15.Text = string.Format("{0}°C", myForecast.list[15].main.temp_min); MinTemp16.Text = string.Format("{0}°C", myForecast.list[16].main.temp_min); MinTemp17.Text = string.Format("{0}°C", myForecast.list[17].main.temp_min); MinTemp18.Text = string.Format("{0}°C", myForecast.list[18].main.temp_min); MinTemp19.Text = string.Format("{0}°C", myForecast.list[19].main.temp_min); MinTemp20.Text = string.Format("{0}°C", myForecast.list[20].main.temp_min); MinTemp21.Text = string.Format("{0}°C", myForecast.list[21].main.temp_min); MinTemp22.Text = string.Format("{0}°C", myForecast.list[22].main.temp_min); MinTemp23.Text = string.Format("{0}°C", myForecast.list[23].main.temp_min); MinTemp24.Text = string.Format("{0}°C", myForecast.list[24].main.temp_min); MinTemp25.Text = string.Format("{0}°C", myForecast.list[25].main.temp_min); MinTemp26.Text = string.Format("{0}°C", myForecast.list[26].main.temp_min); MinTemp27.Text = string.Format("{0}°C", myForecast.list[27].main.temp_min); MinTemp28.Text = string.Format("{0}°C", myForecast.list[28].main.temp_min); MinTemp29.Text = string.Format("{0}°C", myForecast.list[29].main.temp_min); MinTemp30.Text = string.Format("{0}°C", myForecast.list[30].main.temp_min); MinTemp31.Text = string.Format("{0}°C", myForecast.list[31].main.temp_min); MinTemp32.Text = string.Format("{0}°C", myForecast.list[32].main.temp_min); MinTemp33.Text = string.Format("{0}°C", myForecast.list[33].main.temp_min); MinTemp34.Text = string.Format("{0}°C", myForecast.list[34].main.temp_min); MinTemp35.Text = string.Format("{0}°C", myForecast.list[35].main.temp_min); MinTemp36.Text = string.Format("{0}°C", myForecast.list[36].main.temp_min); MinTemp37.Text = string.Format("{0}°C", myForecast.list[37].main.temp_min); MinTemp38.Text = string.Format("{0}°C", myForecast.list[38].main.temp_min); //Displaying weather description Desc0.Text = FirstCharToUpper(myForecast.list[0].weather[0].description); Desc1.Text = FirstCharToUpper(myForecast.list[1].weather[0].description); Desc2.Text = FirstCharToUpper(myForecast.list[2].weather[0].description); Desc3.Text = FirstCharToUpper(myForecast.list[3].weather[0].description); Desc4.Text = FirstCharToUpper(myForecast.list[4].weather[0].description); Desc5.Text = FirstCharToUpper(myForecast.list[5].weather[0].description); Desc6.Text = FirstCharToUpper(myForecast.list[6].weather[0].description); Desc7.Text = FirstCharToUpper(myForecast.list[7].weather[0].description); Desc8.Text = FirstCharToUpper(myForecast.list[8].weather[0].description); Desc9.Text = FirstCharToUpper(myForecast.list[9].weather[0].description); Desc10.Text = FirstCharToUpper(myForecast.list[10].weather[0].description); Desc11.Text = FirstCharToUpper(myForecast.list[11].weather[0].description); Desc12.Text = FirstCharToUpper(myForecast.list[12].weather[0].description); Desc13.Text = FirstCharToUpper(myForecast.list[13].weather[0].description); Desc14.Text = FirstCharToUpper(myForecast.list[14].weather[0].description); Desc15.Text = FirstCharToUpper(myForecast.list[15].weather[0].description); Desc16.Text = FirstCharToUpper(myForecast.list[16].weather[0].description); Desc17.Text = FirstCharToUpper(myForecast.list[17].weather[0].description); Desc18.Text = FirstCharToUpper(myForecast.list[18].weather[0].description); Desc19.Text = FirstCharToUpper(myForecast.list[19].weather[0].description); Desc20.Text = FirstCharToUpper(myForecast.list[20].weather[0].description); Desc21.Text = FirstCharToUpper(myForecast.list[21].weather[0].description); Desc22.Text = FirstCharToUpper(myForecast.list[22].weather[0].description); Desc23.Text = FirstCharToUpper(myForecast.list[23].weather[0].description); Desc24.Text = FirstCharToUpper(myForecast.list[24].weather[0].description); Desc25.Text = FirstCharToUpper(myForecast.list[25].weather[0].description); Desc26.Text = FirstCharToUpper(myForecast.list[26].weather[0].description); Desc27.Text = FirstCharToUpper(myForecast.list[27].weather[0].description); Desc28.Text = FirstCharToUpper(myForecast.list[28].weather[0].description); Desc29.Text = FirstCharToUpper(myForecast.list[29].weather[0].description); Desc30.Text = FirstCharToUpper(myForecast.list[30].weather[0].description); Desc31.Text = FirstCharToUpper(myForecast.list[31].weather[0].description); Desc32.Text = FirstCharToUpper(myForecast.list[32].weather[0].description); Desc33.Text = FirstCharToUpper(myForecast.list[33].weather[0].description); Desc34.Text = FirstCharToUpper(myForecast.list[34].weather[0].description); Desc35.Text = FirstCharToUpper(myForecast.list[35].weather[0].description); Desc36.Text = FirstCharToUpper(myForecast.list[36].weather[0].description); Desc37.Text = FirstCharToUpper(myForecast.list[37].weather[0].description); Desc38.Text = FirstCharToUpper(myForecast.list[38].weather[0].description); //Displaying wind speed Speed0.Text = string.Format("{0} m/s", myForecast.list[0].wind.speed); Speed1.Text = string.Format("{0} m/s", myForecast.list[1].wind.speed); Speed2.Text = string.Format("{0} m/s", myForecast.list[2].wind.speed); Speed3.Text = string.Format("{0} m/s", myForecast.list[3].wind.speed); Speed4.Text = string.Format("{0} m/s", myForecast.list[4].wind.speed); Speed5.Text = string.Format("{0} m/s", myForecast.list[5].wind.speed); Speed6.Text = string.Format("{0} m/s", myForecast.list[6].wind.speed); Speed7.Text = string.Format("{0} m/s", myForecast.list[7].wind.speed); Speed8.Text = string.Format("{0} m/s", myForecast.list[8].wind.speed); Speed9.Text = string.Format("{0} m/s", myForecast.list[9].wind.speed); Speed10.Text = string.Format("{0} m/s", myForecast.list[10].wind.speed); Speed11.Text = string.Format("{0} m/s", myForecast.list[11].wind.speed); Speed12.Text = string.Format("{0} m/s", myForecast.list[12].wind.speed); Speed13.Text = string.Format("{0} m/s", myForecast.list[13].wind.speed); Speed14.Text = string.Format("{0} m/s", myForecast.list[14].wind.speed); Speed15.Text = string.Format("{0} m/s", myForecast.list[15].wind.speed); Speed16.Text = string.Format("{0} m/s", myForecast.list[16].wind.speed); Speed17.Text = string.Format("{0} m/s", myForecast.list[17].wind.speed); Speed18.Text = string.Format("{0} m/s", myForecast.list[18].wind.speed); Speed19.Text = string.Format("{0} m/s", myForecast.list[19].wind.speed); Speed20.Text = string.Format("{0} m/s", myForecast.list[20].wind.speed); Speed21.Text = string.Format("{0} m/s", myForecast.list[21].wind.speed); Speed22.Text = string.Format("{0} m/s", myForecast.list[22].wind.speed); Speed23.Text = string.Format("{0} m/s", myForecast.list[23].wind.speed); Speed24.Text = string.Format("{0} m/s", myForecast.list[24].wind.speed); Speed25.Text = string.Format("{0} m/s", myForecast.list[25].wind.speed); Speed26.Text = string.Format("{0} m/s", myForecast.list[26].wind.speed); Speed27.Text = string.Format("{0} m/s", myForecast.list[27].wind.speed); Speed28.Text = string.Format("{0} m/s", myForecast.list[28].wind.speed); Speed29.Text = string.Format("{0} m/s", myForecast.list[29].wind.speed); Speed30.Text = string.Format("{0} m/s", myForecast.list[30].wind.speed); Speed31.Text = string.Format("{0} m/s", myForecast.list[31].wind.speed); Speed32.Text = string.Format("{0} m/s", myForecast.list[32].wind.speed); Speed33.Text = string.Format("{0} m/s", myForecast.list[33].wind.speed); Speed34.Text = string.Format("{0} m/s", myForecast.list[34].wind.speed); Speed35.Text = string.Format("{0} m/s", myForecast.list[35].wind.speed); Speed36.Text = string.Format("{0} m/s", myForecast.list[36].wind.speed); Speed37.Text = string.Format("{0} m/s", myForecast.list[37].wind.speed); Speed38.Text = string.Format("{0} m/s", myForecast.list[38].wind.speed); //Displaying cloud cover % Cloud0.Text = string.Format("{0} %", myForecast.list[0].clouds.all); Cloud1.Text = string.Format("{0} %", myForecast.list[1].clouds.all); Cloud2.Text = string.Format("{0} %", myForecast.list[2].clouds.all); Cloud3.Text = string.Format("{0} %", myForecast.list[3].clouds.all); Cloud4.Text = string.Format("{0} %", myForecast.list[4].clouds.all); Cloud5.Text = string.Format("{0} %", myForecast.list[5].clouds.all); Cloud6.Text = string.Format("{0} %", myForecast.list[6].clouds.all); Cloud7.Text = string.Format("{0} %", myForecast.list[7].clouds.all); Cloud8.Text = string.Format("{0} %", myForecast.list[8].clouds.all); Cloud9.Text = string.Format("{0} %", myForecast.list[9].clouds.all); Cloud10.Text = string.Format("{0} %", myForecast.list[10].clouds.all); Cloud11.Text = string.Format("{0} %", myForecast.list[11].clouds.all); Cloud12.Text = string.Format("{0} %", myForecast.list[12].clouds.all); Cloud13.Text = string.Format("{0} %", myForecast.list[13].clouds.all); Cloud14.Text = string.Format("{0} %", myForecast.list[14].clouds.all); Cloud15.Text = string.Format("{0} %", myForecast.list[15].clouds.all); Cloud16.Text = string.Format("{0} %", myForecast.list[16].clouds.all); Cloud17.Text = string.Format("{0} %", myForecast.list[17].clouds.all); Cloud18.Text = string.Format("{0} %", myForecast.list[18].clouds.all); Cloud19.Text = string.Format("{0} %", myForecast.list[19].clouds.all); Cloud20.Text = string.Format("{0} %", myForecast.list[20].clouds.all); Cloud21.Text = string.Format("{0} %", myForecast.list[21].clouds.all); Cloud22.Text = string.Format("{0} %", myForecast.list[22].clouds.all); Cloud23.Text = string.Format("{0} %", myForecast.list[23].clouds.all); Cloud24.Text = string.Format("{0} %", myForecast.list[24].clouds.all); Cloud25.Text = string.Format("{0} %", myForecast.list[25].clouds.all); Cloud26.Text = string.Format("{0} %", myForecast.list[26].clouds.all); Cloud27.Text = string.Format("{0} %", myForecast.list[27].clouds.all); Cloud28.Text = string.Format("{0} %", myForecast.list[28].clouds.all); Cloud29.Text = string.Format("{0} %", myForecast.list[29].clouds.all); Cloud30.Text = string.Format("{0} %", myForecast.list[30].clouds.all); Cloud31.Text = string.Format("{0} %", myForecast.list[31].clouds.all); Cloud32.Text = string.Format("{0} %", myForecast.list[32].clouds.all); Cloud33.Text = string.Format("{0} %", myForecast.list[33].clouds.all); Cloud34.Text = string.Format("{0} %", myForecast.list[34].clouds.all); Cloud35.Text = string.Format("{0} %", myForecast.list[35].clouds.all); Cloud36.Text = string.Format("{0} %", myForecast.list[36].clouds.all); Cloud37.Text = string.Format("{0} %", myForecast.list[37].clouds.all); Cloud38.Text = string.Format("{0} %", myForecast.list[38].clouds.all); //Displaying pressure HPA0.Text = string.Format("{0} hPA", myForecast.list[0].main.pressure); HPA1.Text = string.Format("{0} hPA", myForecast.list[1].main.pressure); HPA2.Text = string.Format("{0} hPA", myForecast.list[2].main.pressure); HPA3.Text = string.Format("{0} hPA", myForecast.list[3].main.pressure); HPA4.Text = string.Format("{0} hPA", myForecast.list[4].main.pressure); HPA5.Text = string.Format("{0} hPA", myForecast.list[5].main.pressure); HPA6.Text = string.Format("{0} hPA", myForecast.list[6].main.pressure); HPA7.Text = string.Format("{0} hPA", myForecast.list[7].main.pressure); HPA8.Text = string.Format("{0} hPA", myForecast.list[8].main.pressure); HPA9.Text = string.Format("{0} hPA", myForecast.list[9].main.pressure); HPA10.Text = string.Format("{0} hPA", myForecast.list[10].main.pressure); HPA11.Text = string.Format("{0} hPA", myForecast.list[11].main.pressure); HPA12.Text = string.Format("{0} hPA", myForecast.list[12].main.pressure); HPA13.Text = string.Format("{0} hPA", myForecast.list[13].main.pressure); HPA14.Text = string.Format("{0} hPA", myForecast.list[14].main.pressure); HPA15.Text = string.Format("{0} hPA", myForecast.list[15].main.pressure); HPA16.Text = string.Format("{0} hPA", myForecast.list[16].main.pressure); HPA17.Text = string.Format("{0} hPA", myForecast.list[17].main.pressure); HPA18.Text = string.Format("{0} hPA", myForecast.list[18].main.pressure); HPA19.Text = string.Format("{0} hPA", myForecast.list[19].main.pressure); HPA20.Text = string.Format("{0} hPA", myForecast.list[20].main.pressure); HPA21.Text = string.Format("{0} hPA", myForecast.list[21].main.pressure); HPA22.Text = string.Format("{0} hPA", myForecast.list[22].main.pressure); HPA23.Text = string.Format("{0} hPA", myForecast.list[23].main.pressure); HPA24.Text = string.Format("{0} hPA", myForecast.list[24].main.pressure); HPA25.Text = string.Format("{0} hPA", myForecast.list[25].main.pressure); HPA26.Text = string.Format("{0} hPA", myForecast.list[26].main.pressure); HPA27.Text = string.Format("{0} hPA", myForecast.list[27].main.pressure); HPA28.Text = string.Format("{0} hPA", myForecast.list[28].main.pressure); HPA29.Text = string.Format("{0} hPA", myForecast.list[29].main.pressure); HPA30.Text = string.Format("{0} hPA", myForecast.list[30].main.pressure); HPA31.Text = string.Format("{0} hPA", myForecast.list[31].main.pressure); HPA32.Text = string.Format("{0} hPA", myForecast.list[32].main.pressure); HPA33.Text = string.Format("{0} hPA", myForecast.list[33].main.pressure); HPA34.Text = string.Format("{0} hPA", myForecast.list[34].main.pressure); HPA35.Text = string.Format("{0} hPA", myForecast.list[35].main.pressure); HPA36.Text = string.Format("{0} hPA", myForecast.list[36].main.pressure); HPA37.Text = string.Format("{0} hPA", myForecast.list[37].main.pressure); HPA38.Text = string.Format("{0} hPA", myForecast.list[38].main.pressure); }//Try catch { myMethods.EnableGPSDialog(); }//Catch }//ForecastWeather
public EventModel() { _geoLocationService = new GeoLocationService(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); var app = PropertyCrossApplication.GetApplication(this); app.CurrentActivity = this; var uiMarshal = new MarshalInvokeService(app); var source = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal)); geoLocationService = new GeoLocationService( (Android.Locations.LocationManager)GetSystemService(Context.LocationService), uiMarshal); var stateService = new StatePersistenceService(app); PropertyCrossPersistentState state = stateService.LoadState(); SetContentView (Resource.Layout.PropertyCrossView); searchText = FindViewById<EditText>(Resource.Id.search); searchText.TextChanged += delegate(object sender, Android.Text.TextChangedEventArgs e) { String searchTerm = searchText.Text; if (searchTerm != null) { searchTerm = searchTerm.Trim(); SearchTextChanged(this, new SearchTextChangedEventArgs(searchTerm)); } }; searchText.SetOnEditorActionListener(this); myLocationButton = FindViewById<Button>(Resource.Id.use_location); myLocationButton.Click += LocationButton_Clicked; startSearchButton = (Button) FindViewById(Resource.Id.do_search); startSearchButton.Click += StartSearchButton_Clicked; messageText = (TextView) FindViewById(Resource.Id.mainview_message); resultsHeader = (TextView) FindViewById(Resource.Id.results_header); resultsList = (ListView) FindViewById(Resource.Id.results_list); resultsList.ItemClick += ResultsListItem_Clicked; resultsList.Adapter = new RecentSearchAdapter(this, new List<RecentSearch>()); loadingAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.loading_rotate); loadingAnimation.RepeatMode = RepeatMode.Restart; presenter = new PropertyCrossPresenter(state, source, new NavigationService(app), geoLocationService); presenter.SetView(this); app.Presenter = presenter; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); var app = (PropertyFinderApplication)Application; app.CurrentActivity = this; var uiMarshal = new MarshalInvokeService(app); var source = new PropertyDataSource(new JsonWebPropertySearch(uiMarshal)); geoLocationService = new GeoLocationService((LocationManager)GetSystemService(Context.LocationService), uiMarshal); var stateService = new StatePersistenceService(app); PropertyFinderPersistentState state = stateService.LoadState(); SetContentView (Resource.Layout.PropertyFinderView); searchText = (EditText) FindViewById(Resource.Id.search); searchText.TextChanged += SearchText_Changed; myLocationButton = (Button) FindViewById(Resource.Id.use_location); myLocationButton.Click += LocationButton_Clicked; startSearchButton = (Button) FindViewById(Resource.Id.do_search); startSearchButton.Click += StartSearchButton_Clicked; messageText = (TextView) FindViewById(Resource.Id.mainview_message); recentSearchList = (ListView) FindViewById(Resource.Id.recentsearches_list); recentSearchList.ItemClick += RecentSearchItem_Clicked; adapter = new RecentSearchAdapter(this, new List<RecentSearch>()); recentSearchList.Adapter = adapter; presenter = new PropertyFinderPresenter(state, source, new NavigationService(app), geoLocationService); presenter.SetView(this); app.Presenter = presenter; }
public NewEntryViewModel(GeoLocationService locationService, TripLogDataService tripLogDataService) { _locationService = locationService; _tripLogDataService = tripLogDataService; }
/// <summary> /// Runs the code example. /// </summary> /// <param name="user">The AdWords user.</param> /// <param name="campaignId">Id of the campaign to which location /// extensions are added.</param> public void Run(AdWordsUser user, long campaignId) { // Get the CampaignAdExtensionService. CampaignAdExtensionService campaignExtensionService = (CampaignAdExtensionService)user.GetService(AdWordsService.v201406. CampaignAdExtensionService); // Add location 1: 1600 Amphitheatre Pkwy, Mountain View, US. Address address1 = new Address(); address1.streetAddress = "1600 Amphitheatre Parkway"; address1.cityName = "Mountain View"; address1.provinceCode = "CA"; address1.postalCode = "94043"; address1.countryCode = "US"; // Add location 2: 38 avenue de l'Opéra, 75002 Paris, FR. Address address2 = new Address(); address2.streetAddress = "38 avenue de l'Opéra"; address2.cityName = "Paris"; address2.postalCode = "75002"; address2.countryCode = "FR"; // Get the GeoLocationService. GeoLocationService geoService = (GeoLocationService)user.GetService(AdWordsService.v201406.GeoLocationService); // Create the selector. GeoLocationSelector selector = new GeoLocationSelector(); selector.addresses = new Address[] { address1, address2 }; // Retrieve the locations. GeoLocation[] locations = geoService.get(selector); List <CampaignAdExtensionOperation> operations = new List <CampaignAdExtensionOperation>(); // Phone numbers for US and FR offices. string[] phoneNumbers = new string[] { "(650) 253-0000", "(0)1 42 68 53 00" }; int index = 0; // Create a location extension for each geo location returned by the // server. foreach (GeoLocation location in locations) { LocationExtension locationExtension = new LocationExtension(); locationExtension.address = location.address; locationExtension.geoPoint = location.geoPoint; locationExtension.encodedLocation = location.encodedLocation; locationExtension.source = LocationExtensionSource.ADWORDS_FRONTEND; // Optional: Set the company name. locationExtension.companyName = "ACME Inc."; // Optional: Set the phone number. locationExtension.phoneNumber = phoneNumbers[index]; index++; CampaignAdExtension extension = new CampaignAdExtension(); extension.campaignId = campaignId; extension.status = CampaignAdExtensionStatus.ENABLED; extension.adExtension = locationExtension; CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation(); operation.@operator = Operator.ADD; operation.operand = extension; operations.Add(operation); } try { CampaignAdExtensionReturnValue retVal = campaignExtensionService.mutate(operations.ToArray()); // Display the results. if (retVal != null && retVal.value != null && retVal.value.Length > 0) { foreach (CampaignAdExtension campaignExtension in retVal.value) { Console.WriteLine("Created a location extension with id = \"{0}\" and " + "status = \"{1}\"", campaignExtension.adExtension.id, campaignExtension.status); } } else { Console.WriteLine("No location extensions were created."); } } catch (Exception ex) { throw new System.ApplicationException("Failed to add location extension.", ex); } }
public UsersController() { _identityClient = new IdentityServiceClient(); _geoLocationService = new GeoLocationService(); }
public CustomerController(ITopAtlantaRepository repository, ILogger <CustomerController> logger, GeoLocationService geoLocationService) { _repository = repository; _logger = logger; _geoLocationService = geoLocationService; }
public LocationSearchController() { GeoLocationService = new GeoLocationService <GeocodeResponse>(); }