public void EndCalculateRoute(IAsyncResult e)
{
RouteResponse response = RouteServiceClient.EndCalculateRoute(e);
if ((response.ResponseSummary.StatusCode == RouteService.ResponseStatusCode.Success) &
(response.Result.Legs.Count != 0))
{
LocationCollection locations = new LocationCollection();
foreach (Location p in response.Result.RoutePath.Points)
{
//add the location also to the location collection
locations.Add(p);
}
this.Locations = locations;
this.Distance = response.Result.Summary.Distance;
this.Time = (int)response.Result.Summary.TimeInSeconds / 60 * BikeConsts.DRIVE_TO_BIKE;
}
}