Esempio n. 1
0
        /// <summary>
        /// Return the Traffic Incidents along a given route
        /// </summary>
        /// <param name="route">a route</param>
        /// <param name="distance">a double representing the distance from the route for which
        /// you want incidents reports</param>
        /// <returns>FindResults</returns>
        public FindResults GetTrafficIncident(Route route, Double distance)
        {
            FindResults foundResults;

            try
            {

                if (route == null)
                {
                    throw new System.ArgumentNullException("End location cannot be null");
                }

                FindFilter ff = new FindFilter();
                ff.EntityTypeName = "TrafficIncident";

                FindNearRouteSpecification spec = new FindNearRouteSpecification();
                spec.DataSourceName = "MapPointTravel.TrafficIncidents";
                spec.Distance = distance; //show all incidents within 1 mile of the route
                spec.Route = route; //arg passed in
                spec.Filter = ff;

                foundResults = new FindResults();
                foundResults = theMapPointFindService.FindNearRoute(spec);
            }
            catch (ArgumentNullException e)
            {
                throw e;  // rethrow for app to handle
            }
            catch (Exception e)
            {
                throw e;  // rethrow for app to handle

            }

            return foundResults;
        }
Esempio n. 2
0
 /// <remarks/>
 public void FindNearRouteAsync(FindNearRouteSpecification specification, object userState) {
     if ((this.FindNearRouteOperationCompleted == null)) {
         this.FindNearRouteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindNearRouteOperationCompleted);
     }
     this.InvokeAsync("FindNearRoute", new object[] {
                 specification}, this.FindNearRouteOperationCompleted, userState);
 }
Esempio n. 3
0
 /// <remarks/>
 public System.IAsyncResult BeginFindNearRoute(FindNearRouteSpecification specification, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("FindNearRoute", new object[] {
                 specification}, callback, asyncState);
 }
Esempio n. 4
0
 /// <remarks/>
 public void FindNearRouteAsync(FindNearRouteSpecification specification) {
     this.FindNearRouteAsync(specification, null);
 }
Esempio n. 5
0
 public FindResults FindNearRoute(FindNearRouteSpecification specification) {
     object[] results = this.Invoke("FindNearRoute", new object[] {
                 specification});
     return ((FindResults)(results[0]));
 }