void callHereLauncher(GeoCoordinateInfo stationGeoCoordinate, int callType) // 1 - route direction, 2 - driving guidence, 3 - walking guidence { try { switch (callType) { case 1: DirectionsRouteDestinationTask routeTo = new DirectionsRouteDestinationTask(); routeTo.Destination = stationGeoCoordinate; routeTo.Mode = RouteMode.Car; routeTo.Show(); break; case 2: GuidanceDriveTask driveTo = new GuidanceDriveTask(); driveTo.Destination = stationGeoCoordinate; driveTo.Title = stationGeoCoordinate.locationName; driveTo.Show(); break; case 3: GuidanceWalkTask walkTo = new GuidanceWalkTask(); walkTo.Destination = stationGeoCoordinate; walkTo.Title = stationGeoCoordinate.locationName; walkTo.Show(); break; default: break; } } catch (Exception erno) { if (callType == 1 || callType == 3) { } else { } MessageBox.Show("Error!"); } }
private void Button_gridbut_Click(object sender, RoutedEventArgs e) { if (sender == Driveto) { try { GuidanceDriveTask driveTo = new GuidanceDriveTask(); driveTo.Destination = new GeoCoordinate(Double.Parse(LatitudeBox.Text), Double.Parse(LongittudeBox.Text)); driveTo.Title = StringBox.Text; driveTo.Show(); } catch (Exception erno) { MessageBox.Show("Error message: " + erno.Message); } } else if (sender == Walkto) { try { GuidanceWalkTask walkTo = new GuidanceWalkTask(); walkTo.Destination = new GeoCoordinate(Double.Parse(LatitudeBox.Text), Double.Parse(LongittudeBox.Text)); walkTo.Title = StringBox.Text; walkTo.Show(); } catch (Exception erno) { MessageBox.Show("Error message: " + erno.Message); } } else if (sender == getGeoButton) { NavigationService.Navigate(new Uri("/LocationSelectorPage.xaml?target=Destination", UriKind.Relative)); } }