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

                if (!String.IsNullOrEmpty(Label))
                {
                    writer.WriteAttributeString("label", Label);
                }

                if (Symbol != null)
                {
                    Symbol.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 override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Equality != RangeEquality.Lower)
                {
                    writer.WriteAttributeString("equality", ArcXmlEnumConverter.ToArcXml(typeof(RangeEquality), Equality));
                }

                if (!String.IsNullOrEmpty(Label))
                {
                    writer.WriteAttributeString("label", Label);
                }

                if (!String.IsNullOrEmpty(Lower))
                {
                    writer.WriteAttributeString("lower", Lower);
                }

                if (!String.IsNullOrEmpty(Upper))
                {
                    writer.WriteAttributeString("upper", Upper);
                }

                if (Symbol != null)
                {
                    Symbol.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);
                }
            }
        }
コード例 #3
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(Label))
                {
                    writer.WriteAttributeString("label", Label);
                }

                if (Method != ExactMethod.IsExact)
                {
                    writer.WriteAttributeString("method", ArcXmlEnumConverter.ToArcXml(typeof(ExactMethod), Method));
                }

                if (!String.IsNullOrEmpty(Value))
                {
                    writer.WriteAttributeString("value", Value);
                }

                if (Symbol != null)
                {
                    Symbol.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);
                }
            }
        }
コード例 #4
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(Field))
                {
                    writer.WriteAttributeString("field", Field);
                }

                if (FeatureWeight != LabelWeight.NoWeight)
                {
                    writer.WriteAttributeString("featureweight", ArcXmlEnumConverter.ToArcXml(typeof(LabelWeight), FeatureWeight));
                }

                if (HowManyLabels != HowManyLabels.OneLabelPerShape)
                {
                    writer.WriteAttributeString("howmanylabels", ArcXmlEnumConverter.ToArcXml(typeof(HowManyLabels), HowManyLabels));
                }

                if (LabelBufferRatio > 0)
                {
                    writer.WriteAttributeString("labelbufferratio", LabelBufferRatio.ToString("0.000"));
                }

                if (!String.IsNullOrEmpty(LabelPriorities))
                {
                    writer.WriteAttributeString("labelpriorities", LabelPriorities);
                }

                if (LabelWeight != LabelWeight.HighWeight)
                {
                    writer.WriteAttributeString("labelweight", ArcXmlEnumConverter.ToArcXml(typeof(LabelWeight), LabelWeight));
                }

                if (LineLabelPosition != LineLabelPosition.PlaceAbove)
                {
                    writer.WriteAttributeString("linelabelposition", ArcXmlEnumConverter.ToArcXml(typeof(LineLabelPosition), LineLabelPosition));
                }

                if (!String.IsNullOrEmpty(RotationalAngles))
                {
                    writer.WriteAttributeString("rotationalangles", RotationalAngles);
                }

                if (Symbol != null)
                {
                    Symbol.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);
                }
            }
        }
コード例 #5
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!String.IsNullOrEmpty(Lower))
                {
                    writer.WriteAttributeString("lower", Lower);
                }

                if (Alignment != ObjectAlignment.BottomLeft)
                {
                    writer.WriteAttributeString("alignment", ArcXmlEnumConverter.ToArcXml(typeof(ObjectAlignment), Alignment));
                }

                writer.WriteAttributeString("units", ArcXmlEnumConverter.ToArcXml(typeof(ObjectUnits), Units));

                if (!String.IsNullOrEmpty(Upper))
                {
                    writer.WriteAttributeString("upper", Upper);
                }

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

                if (_shape != null)
                {
                    if (_shape.OgcGeometryType == OgcGeometryType.Point)
                    {
                        GeometrySerializer.WriteAsMultiPointTo(writer, (IPoint)_shape);
                    }
                    else
                    {
                        GeometrySerializer.WriteTo(writer, _shape);
                    }

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

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

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

                if (_text != null)
                {
                    bool symbolAdded = false;

                    if (_text.Symbol == null)
                    {
                        _text.Symbol = (TextMarkerSymbol)Symbol;
                        symbolAdded  = true;
                    }

                    _text.WriteTo(writer);

                    if (symbolAdded)
                    {
                        _text.Symbol = null;
                    }
                }

                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);
                }
            }
        }