Exemplo n.º 1
0
        public static Features ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Features features = new Features();

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

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            switch (reader.Name)
                            {
                            case "ENVELOPE": features.Envelope = EnvelopeSerializer.ReadFrom(reader); break;

                            case FeatureCount.XmlName: features.FeatureCount = FeatureCount.ReadFrom(reader); break;

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

                        reader.Read();
                    }
                }

                return(features);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Exemplo n.º 2
0
        public static FeatureCount ReadFrom(ArcXmlReader reader)
        {
            try
            {
                FeatureCount featureCount = new FeatureCount();

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

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

                            case "hasmore": featureCount.HasMore = Convert.ToBoolean(value); break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(featureCount);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
Exemplo n.º 3
0
        public object Clone()
        {
            FeatureCount clone = (FeatureCount)this.MemberwiseClone();

            return(clone);
        }