Example #1
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);
                }
            }
        }
Example #2
0
        public static GcCount ReadFrom(ArcXmlReader reader)
        {
            try
            {
                GcCount gcCount = new GcCount();

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        string value = reader.ReadContentAsString();

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "count": gcCount.Count = Convert.ToInt32(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(gcCount);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Example #3
0
        public object Clone()
        {
            GcCount clone = (GcCount)this.MemberwiseClone();

            return(clone);
        }