コード例 #1
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Background != null)
                {
                    Background.WriteTo(writer);
                }

                if (!Envelope.IsNull)
                {
                    EnvelopeSerializer.WriteTo(writer, Envelope);
                }

                if (FeatureCoordSys != null)
                {
                    FeatureCoordSys.WriteTo(writer);
                }

                if (FilterCoordSys != null)
                {
                    FilterCoordSys.WriteTo(writer);
                }

                if (ImageSize != null)
                {
                    ImageSize.WriteTo(writer);
                }

                if (LayerList != null)
                {
                    LayerList.WriteTo(writer);
                }

                if (Output != null)
                {
                    Output.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }
コード例 #2
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(ID))
                {
                    writer.WriteAttributeString("id", ID);
                }

                if (!Envelope.IsNull)
                {
                    EnvelopeSerializer.WriteTo(writer, Envelope);
                }

                if (FeatureCoordSys != null)
                {
                    FeatureCoordSys.WriteTo(writer);
                }

                if (FilterCoordSys != null)
                {
                    FilterCoordSys.WriteTo(writer);
                }

                if (LayerList != null)
                {
                    LayerList.WriteTo(writer);
                }

                if (Scale != null)
                {
                    Scale.WriteTo(writer);
                }

                writer.WriteEndElement();
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not write {0} object.", GetType().Name), ex);
                }
            }
        }