Beispiel #1
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (CapType != CapType.Butt)
                {
                    writer.WriteAttributeString("captype", ArcXmlEnumConverter.ToArcXml(typeof(CapType), CapType));
                }

                if (!Color.IsEmpty && Color != Color.Black)
                {
                    writer.WriteAttributeString("color", ColorConverter.ToArcXml(Color));
                }

                if (JoinType != JoinType.Round)
                {
                    writer.WriteAttributeString("jointype", ArcXmlEnumConverter.ToArcXml(typeof(JoinType), JoinType));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (Type != LineType.Solid)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(LineType), Type));
                }

                if (Width > 1)
                {
                    writer.WriteAttributeString("width", Width.ToString());
                }

                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);
                }
            }
        }
Beispiel #2
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!TransparentColor.IsEmpty)
                {
                    writer.WriteAttributeString("transcolor", ColorConverter.ToArcXml(TransparentColor));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                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);
                }
            }
        }
Beispiel #3
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                writer.WriteAttributeString("coords", X.ToString() + writer.CoordinateSeparator[0] + Y.ToString());
                writer.WriteAttributeString("type", Type.ToString());

                if (Angle != 0)
                {
                    writer.WriteAttributeString("angle", Angle.ToString());
                }

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!Outline.IsEmpty)
                {
                    writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (Size != 30)
                {
                    writer.WriteAttributeString("size", Size.ToString());
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString());
                }

                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);
                }
            }
        }
Beispiel #4
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!FinishColor.IsEmpty)
                {
                    writer.WriteAttributeString("finishcolor", ColorConverter.ToArcXml(FinishColor));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (!StartColor.IsEmpty)
                {
                    writer.WriteAttributeString("startcolor", ColorConverter.ToArcXml(StartColor));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (Type != GradientFillType.BDiagonal)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(GradientFillType), Type));
                }

                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);
                }
            }
        }
Beispiel #5
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!Color.IsEmpty && Color != Color.Black)
                {
                    writer.WriteAttributeString("color", ColorConverter.ToArcXml(Color));
                }

                if (!String.IsNullOrEmpty(LookUpField))
                {
                    writer.WriteAttributeString("lookupfield", LookUpField);
                }

                if (Lower > Int32.MinValue)
                {
                    writer.WriteAttributeString("lower", Lower.ToString());
                }

                if (Upper > Int32.MinValue)
                {
                    writer.WriteAttributeString("upper", Upper.ToString());
                }

                if (Value > Int32.MinValue)
                {
                    writer.WriteAttributeString("value", Value.ToString());
                }

                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);
                }
            }
        }
Beispiel #6
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (Boundary)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!String.IsNullOrEmpty(Font) && String.Compare(Font, "Arial", true) != 0)
                {
                    writer.WriteAttributeString("font", Font);
                }

                if (FontColor != Color.Black)
                {
                    writer.WriteAttributeString("fontcolor", ColorConverter.ToArcXml(FontColor));
                }

                if (FontSize != 12)
                {
                    writer.WriteAttributeString("fontsize", FontSize.ToString());
                }

                if (FontStyle != FontStyle.Regular)
                {
                    writer.WriteAttributeString("fontstyle", ArcXmlEnumConverter.ToArcXml(typeof(FontStyle), FontStyle));
                }

                if (!String.IsNullOrEmpty(Image))
                {
                    writer.WriteAttributeString("image", Image);
                }

                if (LabelMode != ShieldLabelMode.NumericOnly)
                {
                    writer.WriteAttributeString("labelmode", ArcXmlEnumConverter.ToArcXml(typeof(ShieldLabelMode), LabelMode));
                }

                if (PrintMode != PrintMode.None)
                {
                    writer.WriteAttributeString("printmode", ArcXmlEnumConverter.ToArcXml(typeof(PrintMode), PrintMode));
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (TextPosition != null)
                {
                    writer.WriteAttributeString("textposition", String.Format("{0},{1}", TextPosition.Coordinate.X, TextPosition.Coordinate.Y));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (!String.IsNullOrEmpty(Url))
                {
                    writer.WriteAttributeString("url", Url);
                }

                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);
                }
            }
        }
Beispiel #7
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (MaxSize > 0)
                {
                    writer.WriteAttributeString("maxsize", MaxSize.ToString());
                }

                if (MaxSize > 0 && MaxValue > 0)
                {
                    writer.WriteAttributeString("maxvalue", MaxValue.ToString());
                }

                if (MinSize > 0)
                {
                    writer.WriteAttributeString("minsize", MinSize.ToString());
                }

                if (MinSize > 0 && MinValue > 0)
                {
                    writer.WriteAttributeString("minvalue", MinValue.ToString());
                }

                if (Mode != ChartSymbolMode.Pie)
                {
                    writer.WriteAttributeString("mode", ArcXmlEnumConverter.ToArcXml(typeof(ChartSymbolMode), Mode));
                }

                if (!Outline.IsEmpty)
                {
                    writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline));
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (Size > 0)
                {
                    writer.WriteAttributeString("size", Size.ToString());
                }

                if (!String.IsNullOrEmpty(SizeField))
                {
                    writer.WriteAttributeString("sizefield", SizeField);
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (Width > 0)
                {
                    writer.WriteAttributeString("width", Width.ToString());
                }

                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);
                }
            }
        }
Beispiel #8
0
        public void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                writer.WriteAttributeString("coords", X.ToString() + writer.CoordinateSeparator[0] + Y.ToString());

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (BarColor != Color.FromArgb(255, 162, 115))
                {
                    writer.WriteAttributeString("barcolor", ColorConverter.ToArcXml(BarColor));
                }

                if (BarColor.A > 0)
                {
                    writer.WriteAttributeString("bartransparency", (BarColor.A / 255.0).ToString("0.000"));
                }

                if (Distance > 0)
                {
                    writer.WriteAttributeString("distance", Distance.ToString());
                }

                if (!String.IsNullOrEmpty(Font) && Font != "Arial")
                {
                    writer.WriteAttributeString("font", Font);
                }

                if (FontColor != Color.Black)
                {
                    writer.WriteAttributeString("fontcolor", ColorConverter.ToArcXml(FontColor));
                }

                if (FontColor.A > 255)
                {
                    writer.WriteAttributeString("texttransparency", (FontColor.A / 255.0).ToString("0.000"));
                }

                if (FontSize != 10)
                {
                    writer.WriteAttributeString("fontsize", FontSize.ToString());
                }

                if (FontStyle != FontStyle.Regular)
                {
                    writer.WriteAttributeString("fontstyle", ArcXmlEnumConverter.ToArcXml(typeof(FontStyle), FontStyle));
                }

                if (MapUnits != Units.Degrees)
                {
                    writer.WriteAttributeString("mapunits", ArcXmlEnumConverter.ToArcXml(typeof(Units), MapUnits));
                }

                if (Mode != ScaleBarMode.Cartesian)
                {
                    writer.WriteAttributeString("mode", ArcXmlEnumConverter.ToArcXml(typeof(ScaleBarMode), Mode));
                }

                if (!Outline.IsEmpty)
                {
                    writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (Precision > 0)
                {
                    writer.WriteAttributeString("precision", Precision.ToString());
                }

                if (Round > 0)
                {
                    writer.WriteAttributeString("round", Round.ToString());
                }

                if (ScaleUnits != ScaleUnits.Miles)
                {
                    writer.WriteAttributeString("scaleunits", ArcXmlEnumConverter.ToArcXml(typeof(ScaleUnits), ScaleUnits));
                }

                if (ScreenLength > 0)
                {
                    writer.WriteAttributeString("screenlength", ScreenLength.ToString());
                }

                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);
                }
            }
        }
Beispiel #9
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Angle > 0)
                {
                    writer.WriteAttributeString("angle", Angle.ToString());
                }

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!BlockOut.IsEmpty)
                {
                    writer.WriteAttributeString("blockout", ColorConverter.ToArcXml(BlockOut));
                }

                if (!String.IsNullOrEmpty(Font) && String.Compare(Font, "Arial", true) != 0)
                {
                    writer.WriteAttributeString("font", Font);
                }

                if (!FontColor.IsEmpty && FontColor != Color.Black)
                {
                    writer.WriteAttributeString("fontcolor", ColorConverter.ToArcXml(FontColor));
                }

                if (FontSize != 12)
                {
                    writer.WriteAttributeString("fontsize", FontSize.ToString());
                }

                if (FontStyle != FontStyle.Regular)
                {
                    writer.WriteAttributeString("fontstyle", ArcXmlEnumConverter.ToArcXml(typeof(FontStyle), FontStyle));
                }

                if (!Glowing.IsEmpty)
                {
                    writer.WriteAttributeString("glowing", ColorConverter.ToArcXml(Glowing));
                }

                if (HAlignment != HorizontalAlignment.Right)
                {
                    writer.WriteAttributeString("halignment", ArcXmlEnumConverter.ToArcXml(typeof(HorizontalAlignment), HAlignment));
                }

                if (Interval > 0)
                {
                    writer.WriteAttributeString("interval", Interval.ToString());
                }

                if (!Outline.IsEmpty)
                {
                    writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (PrintMode != PrintMode.None)
                {
                    writer.WriteAttributeString("printmode", ArcXmlEnumConverter.ToArcXml(typeof(PrintMode), PrintMode));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (VAlignment != VerticalAlignment.Top)
                {
                    writer.WriteAttributeString("valignment", ArcXmlEnumConverter.ToArcXml(typeof(VerticalAlignment), VAlignment));
                }

                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);
                }
            }
        }
Beispiel #10
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!Color.IsEmpty && Color != Color.Black)
                {
                    writer.WriteAttributeString("color", ColorConverter.ToArcXml(Color));
                }

                if (!Outline.IsEmpty)
                {
                    writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (Type != MarkerType.Circle)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(MarkerType), Type));
                }

                writer.WriteAttributeString("usecentroid", UseCentroid ? "true" : "false");

                if (Width > 1)
                {
                    writer.WriteAttributeString("width", Width.ToString());
                }

                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);
                }
            }
        }
Beispiel #11
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!Boundary)
                {
                    writer.WriteAttributeString("boundary", "false");
                }
                else
                {
                    if (BoundaryCapType != CapType.Butt)
                    {
                        writer.WriteAttributeString("boundarycaptype", ArcXmlEnumConverter.ToArcXml(typeof(CapType), BoundaryCapType));
                    }

                    if (Color.FromArgb(0, BoundaryColor) != Color.Black)
                    {
                        writer.WriteAttributeString("boundarycolor", ColorConverter.ToArcXml(BoundaryColor));
                    }

                    if (BoundaryColor.A > 0)
                    {
                        writer.WriteAttributeString("boundarytransparency", (BoundaryColor.A / 255.0).ToString("0.000"));
                    }

                    if (BoundaryJoinType != JoinType.Round)
                    {
                        writer.WriteAttributeString("boundaryjointype", ArcXmlEnumConverter.ToArcXml(typeof(JoinType), BoundaryJoinType));
                    }

                    if (BoundaryType != LineType.Solid)
                    {
                        writer.WriteAttributeString("boundarytype", ArcXmlEnumConverter.ToArcXml(typeof(LineType), BoundaryType));
                    }

                    if (BoundaryWidth > 1)
                    {
                        writer.WriteAttributeString("boundarywidth", BoundaryWidth.ToString());
                    }
                }

                if (Color.FromArgb(0, FillColor) != Color.FromArgb(0, 200, 0))
                {
                    writer.WriteAttributeString("fillcolor", ColorConverter.ToArcXml(FillColor));
                }

                if (FillColor.A > 0)
                {
                    writer.WriteAttributeString("filltransparency", (FillColor.A / 255.0).ToString("0.000"));
                }

                if (FillType != FillType.Solid)
                {
                    writer.WriteAttributeString("filltype", ArcXmlEnumConverter.ToArcXml(typeof(FillType), FillType));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                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);
                }
            }
        }
Beispiel #12
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!BackColor.IsEmpty)
                {
                    writer.WriteAttributeString("backcolor", ColorConverter.ToArcXml(BackColor));
                }

                if (!BoundaryColor.IsEmpty)
                {
                    writer.WriteAttributeString("boundarycolor", ColorConverter.ToArcXml(BoundaryColor));
                }

                if (!String.IsNullOrEmpty(Font) && String.Compare(Font, "Arial", true) != 0)
                {
                    writer.WriteAttributeString("font", Font);
                }

                if (!FontColor.IsEmpty && FontColor != Color.Black)
                {
                    writer.WriteAttributeString("fontcolor", ColorConverter.ToArcXml(FontColor));
                }

                if (FontSize != 12)
                {
                    writer.WriteAttributeString("fontsize", FontSize.ToString());
                }

                if (FontStyle != FontStyle.Regular)
                {
                    writer.WriteAttributeString("fontstyle", ArcXmlEnumConverter.ToArcXml(typeof(FontStyle), FontStyle));
                }

                if (!Glowing.IsEmpty)
                {
                    writer.WriteAttributeString("glowing", ColorConverter.ToArcXml(Glowing));
                }

                if (Interval > 0)
                {
                    writer.WriteAttributeString("interval", Interval.ToString());
                }

                if (!Outline.IsEmpty)
                {
                    writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline));
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                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);
                }
            }
        }
Beispiel #13
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (Hotspot != null)
                {
                    writer.WriteAttributeString("hotspot", String.Format("{0},{1}", Hotspot.Coordinate.X, Hotspot.Coordinate.Y));
                }

                if (!String.IsNullOrEmpty(Image))
                {
                    writer.WriteAttributeString("image", Image);
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (!String.IsNullOrEmpty(Url))
                {
                    writer.WriteAttributeString("url", Url);
                }

                if (UseCentroid)
                {
                    writer.WriteAttributeString("usecentroid", "true");
                }

                if (Width > 0 && Height > 0)
                {
                    writer.WriteAttributeString("size", String.Format("{0},{1}", Width, Height));
                }

                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);
                }
            }
        }
Beispiel #14
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Angle >= 0)
                {
                    writer.WriteAttributeString("angle", Angle.ToString("0.000"));
                }

                if (!String.IsNullOrEmpty(AngleField))
                {
                    writer.WriteAttributeString("anglefield", AngleField);
                }

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (Character >= 32)
                {
                    writer.WriteAttributeString("character", Character.ToString());
                }

                if (!String.IsNullOrEmpty(Font) && String.Compare(Font, "Arial", true) != 0)
                {
                    writer.WriteAttributeString("font", Font);
                }

                if (!FontColor.IsEmpty && FontColor != Color.Black)
                {
                    writer.WriteAttributeString("fontcolor", ColorConverter.ToArcXml(FontColor));
                }

                if (FontSize != 12)
                {
                    writer.WriteAttributeString("fontsize", FontSize.ToString());
                }

                if (FontStyle != FontStyle.Regular)
                {
                    writer.WriteAttributeString("fontstyle", ArcXmlEnumConverter.ToArcXml(typeof(FontStyle), FontStyle));
                }

                if (!Glowing.IsEmpty)
                {
                    writer.WriteAttributeString("glowing", ColorConverter.ToArcXml(Glowing));
                }

                if (!Outline.IsEmpty)
                {
                    writer.WriteAttributeString("outline", ColorConverter.ToArcXml(Outline));
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (RotateMethod != RotateMethod.ModArithmetic)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(RotateMethod), RotateMethod));
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                writer.WriteAttributeString("usecentroid", UseCentroid ? "true" : "false");

                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);
                }
            }
        }
Beispiel #15
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "true");
                }

                if (!Color.IsEmpty && Color != Color.Black)
                {
                    writer.WriteAttributeString("color", ColorConverter.ToArcXml(Color));
                }

                if (Interval != 8 && Interval >= 0)
                {
                    writer.WriteAttributeString("interval", Interval.ToString());
                }

                if (LineThickness > 1)
                {
                    writer.WriteAttributeString("linethickness", LineThickness.ToString());
                }

                if (TickThickness > 1)
                {
                    writer.WriteAttributeString("tickthickness", TickThickness.ToString());
                }

                if (!Overlap)
                {
                    writer.WriteAttributeString("overlap", "false");
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (Type != HashLineType.Foreground)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(HashLineType), Type));
                }

                if (Width != 6 && Width >= 0)
                {
                    writer.WriteAttributeString("width", Width.ToString());
                }

                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);
                }
            }
        }
Beispiel #16
0
        public override void WriteTo(ArcXmlWriter writer)
        {
            try
            {
                writer.WriteStartElement(XmlName);

                if (!Antialiasing)
                {
                    writer.WriteAttributeString("antialiasing", "false");
                }

                if (!BottomColor.IsEmpty && BottomColor != Color.FromArgb(0, 0, 250))
                {
                    writer.WriteAttributeString("bottomcolor", ColorConverter.ToArcXml(BottomColor));
                }

                if (!String.IsNullOrEmpty(Font) && String.Compare(Font, "Arial", true) != 0)
                {
                    writer.WriteAttributeString("font", Font);
                }

                if (FontColor != Color.Black)
                {
                    writer.WriteAttributeString("fontcolor", ColorConverter.ToArcXml(FontColor));
                }

                if (FontSize != 12)
                {
                    writer.WriteAttributeString("fontsize", FontSize.ToString());
                }

                if (FontStyle != FontStyle.Regular)
                {
                    writer.WriteAttributeString("fontstyle", ArcXmlEnumConverter.ToArcXml(typeof(FontStyle), FontStyle));
                }

                if (LabelMode != ShieldLabelMode.NumericOnly)
                {
                    writer.WriteAttributeString("labelmode", ArcXmlEnumConverter.ToArcXml(typeof(ShieldLabelMode), LabelMode));
                }

                if (!MiddleColor.IsEmpty && MiddleColor != Color.FromArgb(0, 0, 250))
                {
                    writer.WriteAttributeString("middlecolor", ColorConverter.ToArcXml(MiddleColor));
                }

                if (MinSize != 12)
                {
                    writer.WriteAttributeString("minsize", MinSize.ToString());
                }

                if (!Shadow.IsEmpty)
                {
                    writer.WriteAttributeString("shadow", ColorConverter.ToArcXml(Shadow));
                }

                if (!TopColor.IsEmpty && TopColor != Color.FromArgb(250, 0, 0))
                {
                    writer.WriteAttributeString("topcolor", ColorConverter.ToArcXml(TopColor));
                }

                if (0 <= Transparency && Transparency < 1)
                {
                    writer.WriteAttributeString("transparency", Transparency.ToString("0.000"));
                }

                if (Type != ShieldType.Interstate)
                {
                    writer.WriteAttributeString("type", ArcXmlEnumConverter.ToArcXml(typeof(ShieldType), Type));
                }

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