/// <summary> /// Start geocode. /// </summary> /// <param name="objects">Objects to geocoding.</param> /// <param name="type">Geocode type.</param> private void _Geocode(IList <AppData.DataObject> objects, GeocodeType type) { Debug.Assert(null != objects); // created Debug.Assert(0 < objects.Count); // not empty Debug.Assert(null != _checker); // inited _checker.ThrowIfCancellationRequested(); switch (type) { case GeocodeType.Batch: _BatchGeocode(objects); break; case GeocodeType.Reverse: _ReverseGeocode(objects); break; case GeocodeType.Complete: _SourceGeocode(objects); break; case GeocodeType.NotSet: _EmptyGeocode(objects); break; default: Debug.Assert(false); // NOTE: not supported break; } }
/////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Geocodes objects /// </summary> /// <param name="objects">Objects to geocoding.</param> /// <param name="type">Geocoding type.</param> /// <param name="checker">Cancellation checker.</param> public void Geocode(IList <AppData.DataObject> objects, GeocodeType type, ICancellationChecker checker) { Debug.Assert(null != objects); // created Debug.Assert(0 < objects.Count); // not empty Debug.Assert(null != _GetGeocodable(objects[0])); // valid call Debug.Assert(null != checker); // created // reset internal state first _detectedException = null; _geocodedCount = 0; _details.Clear(); // store checker _checker = checker; // start geocode _Geocode(objects, type); }
/// <summary> /// Start geocode. /// </summary> /// <param name="objects">Objects to geocoding.</param> /// <param name="type">Geocode type.</param> private void _Geocode(IList<AppData.DataObject> objects, GeocodeType type) { Debug.Assert(null != objects); // created Debug.Assert(0 < objects.Count); // not empty Debug.Assert(null != _checker); // inited _checker.ThrowIfCancellationRequested(); switch (type) { case GeocodeType.Batch: _BatchGeocode(objects); break; case GeocodeType.Reverse: _ReverseGeocode(objects); break; case GeocodeType.Complete: _SourceGeocode(objects); break; case GeocodeType.NotSet: _EmptyGeocode(objects); break; default: Debug.Assert(false); // NOTE: not supported break; } }
/////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Geocodes objects /// </summary> /// <param name="objects">Objects to geocoding.</param> /// <param name="type">Geocoding type.</param> /// <param name="checker">Cancellation checker.</param> public void Geocode(IList<AppData.DataObject> objects, GeocodeType type, ICancellationChecker checker) { Debug.Assert(null != objects); // created Debug.Assert(0 < objects.Count); // not empty Debug.Assert(null != _GetGeocodable(objects[0])); // valid call Debug.Assert(null != checker); // created // reset internal state first _detectedException = null; _geocodedCount = 0; _details.Clear(); // store checker _checker = checker; // start geocode _Geocode(objects, type); }