예제 #1
0
        public override object Clone()
        {
            Geocode clone = (Geocode)this.MemberwiseClone();

            if (GcCount != null)
            {
                clone.GcCount = (GcCount)GcCount.Clone();
            }

            if (Features != null)
            {
                clone.Features = Features.Select(o => (Feature)o.Clone()).ToList();
            }

            return(clone);
        }
예제 #2
0
        public static Geocode ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Geocode geocode = new Geocode();

                if (!reader.IsEmptyElement)
                {
                    reader.Read();

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            switch (reader.Name)
                            {
                            case GcCount.XmlName: geocode.GcCount = GcCount.ReadFrom(reader); break;

                            case Feature.XmlName: geocode.Features.Add(Feature.ReadFrom(reader)); break;
                            }
                        }

                        reader.Read();
                    }
                }

                return(geocode);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }