Ejemplo n.º 1
0
        /// <summary>
        /// Updates geocodable information.
        /// </summary>
        /// <param name="needMessage">Need show message.</param>
        /// <param name="candidate">Geocoded candidate (can be NULL).</param>
        /// <param name="obj">Source object to geocoded candidate.</param>
        private void _UpdateGeocodableInfo(bool needMessage,
                                           AddressCandidate candidate,
                                           AppData.DataObject obj)
        {
            Debug.Assert(null != obj); // Created.

            IGeocodable geocodable = _GetGeocodable(obj);
            geocodable.GeoLocation = null;

            if ((null == candidate) || (candidate.Score <= App.Current.Geocoder.MinimumMatchScore))
            {
                // Not geocoded.
                geocodable.Address.MatchMethod = string.Empty;
            }
            else
            {
                GeocodeHelpers.SetCandidate(geocodable, candidate);
                ++_geocodedCount;

                // Store warning.
                if (needMessage)
                {
                    string objectName = _informer.ObjectName;
                    string errorTextFormat =
                        App.Current.GetString("ImportProcessStatusRecordOutMapExtendGeocodedFormat",
                                              objectName.ToLower(),
                                              "{0}",
                                              objectName);
                    var description =
                        new MessageDetail(MessageType.Warning, errorTextFormat, obj);
                    _details.Add(description);
                }
            }
        }
Ejemplo n.º 2
0
 ///////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Gets geocodable interface from data object.
 /// </summary>
 /// <param name="obj">Data object to conversion.</param>
 /// <returns>Geocodable interface.</returns>
 private IGeocodable _GetGeocodable(AppData.DataObject obj)
 {
     var geocodable = obj as IGeocodable;
     Debug.Assert(null != geocodable); // valid type
     return geocodable;
 }