///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        public object Clone()
        {
            ImportSettings obj = new ImportSettings();
            obj._source = this._source;
            obj._tableName = this._tableName;

            foreach (FieldMap map in this._fieldsMap)
                obj._fieldsMap.Add(map);

            return obj;
        }
        private ImportSettings _LoadSettings(XmlNode nodeSettings, ImportType type)
        {
            ImportSettings settings = new ImportSettings();
            foreach (XmlNode node in nodeSettings.ChildNodes)
            {
                if (node.NodeType != XmlNodeType.Element)
                    continue; // skip comments and other non element nodes

                if (node.Name.Equals(NODE_NAME_SOURCE, StringComparison.OrdinalIgnoreCase))
                {
                    if (null != node.FirstChild)
                        settings.Source = node.FirstChild.Value;
                }
                else if (node.Name.Equals(NODE_NAME_TABLE, StringComparison.OrdinalIgnoreCase))
                    settings.TableName = node.Attributes[ATTRIBUTE_NAME_NAME].Value;
                else if (node.Name.Equals(NODE_NAME_FIELDSMAPPING, StringComparison.OrdinalIgnoreCase))
                   settings.FieldsMap = _LoadFieldsMap(node, type);
            }

            return settings;
        }
        private void _SaveProfileSettings(ImportSettings settings, XmlWriter writer)
        {
            writer.WriteStartElement(NODE_NAME_SETTINGS);
              writer.WriteStartElement(NODE_NAME_SOURCE);
              writer.WriteValue(settings.Source);
              writer.WriteEndElement();

              writer.WriteStartElement(NODE_NAME_TABLE);
              writer.WriteAttributeString(ATTRIBUTE_NAME_NAME, settings.TableName);
              writer.WriteEndElement();

              _SaveFieldsMap(settings.FieldsMap, writer);
            writer.WriteEndElement();
        }
        /// <summary>
        /// Gets geocoding type.
        /// </summary>
        /// <param name="settings">Import settings.</param>
        /// <returns>Geocoding type.</returns>
        private Geocoder.GeocodeType _GetGeocodeType(ImportSettings settings)
        {
            Debug.Assert(null != settings); // created

            IList<FieldMap> fieldsMap = settings.FieldsMap;
            bool isAddressFieldsMapped = _IsMandatoryFieldsMapped(fieldsMap, typeof(Address), false);

            bool isGeoLocationFieldsMapped =
                _IsMandatoryFieldsMapped(fieldsMap, typeof(AppGeometry.Point), true);
            bool isGeometryUsed = FileHelpers.IsShapeFile(settings.Source);

            var type = Geocoder.GeocodeType.NotSet;
            if (isAddressFieldsMapped &&
                (isGeoLocationFieldsMapped || isGeometryUsed))
                type = Geocoder.GeocodeType.Complete;
            else if (isAddressFieldsMapped)
                type = Geocoder.GeocodeType.Batch;
            else if (isGeoLocationFieldsMapped || isGeometryUsed)
                type = Geocoder.GeocodeType.Reverse;
            // else type = Geocoder.GeocodeType.NotSet;

            return type;
        }