コード例 #1
0
        public override object Clone()
        {
            RasterShieldSymbol clone = (RasterShieldSymbol)this.MemberwiseClone();

            return(clone);
        }
コード例 #2
0
        public static RasterShieldSymbol ReadFrom(ArcXmlReader reader)
        {
            try
            {
                RasterShieldSymbol rasterShieldSymbol = new RasterShieldSymbol();

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

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "antialiasing": rasterShieldSymbol.Antialiasing = Convert.ToBoolean(value); break;

                            case "boundary": rasterShieldSymbol.Boundary = Convert.ToBoolean(value); break;

                            case "font": rasterShieldSymbol.Font = value; break;

                            case "fontcolor": rasterShieldSymbol.FontColor = ColorConverter.ToColor(value); break;

                            case "fontsize": rasterShieldSymbol.FontSize = Convert.ToInt32(value); break;

                            case "fontstyle": rasterShieldSymbol.FontStyle = (FontStyle)ArcXmlEnumConverter.ToEnum(typeof(FontStyle), value); break;

                            case "image": rasterShieldSymbol.Image = value; break;

                            case "labelmode": rasterShieldSymbol.LabelMode = (ShieldLabelMode)ArcXmlEnumConverter.ToEnum(typeof(ShieldLabelMode), value); break;

                            case "printmode": rasterShieldSymbol.PrintMode = (PrintMode)ArcXmlEnumConverter.ToEnum(typeof(PrintMode), value); break;

                            case "shadow": rasterShieldSymbol.Shadow = ColorConverter.ToColor(value); break;

                            case "transparency": rasterShieldSymbol.Transparency = Convert.ToDouble(value); break;

                            case "url": rasterShieldSymbol.Url = value; break;

                            case "textposition":
                                string[] p = value.Split(new char[] { ',' });
                                rasterShieldSymbol.TextPosition = new NetTopologySuite.Geometries.Point(Convert.ToDouble(p[0]), Convert.ToDouble(p[1]));
                                break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

                return(rasterShieldSymbol);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }
コード例 #3
0
        public static Exact ReadFrom(ArcXmlReader reader)
        {
            try
            {
                Exact exact = new Exact();

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

                        if (value.Length > 0)
                        {
                            switch (reader.Name)
                            {
                            case "label": exact.Label = value; break;

                            case "method": exact.Method = (ExactMethod)ArcXmlEnumConverter.ToEnum(typeof(ExactMethod), value); break;

                            case "value": exact.Value = value; break;
                            }
                        }
                    }

                    reader.MoveToElement();
                }

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

                    while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName))
                    {
                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            switch (reader.Name)
                            {
                            case CallOutMarkerSymbol.XmlName: exact.Symbol = CallOutMarkerSymbol.ReadFrom(reader); break;

                            case ChartSymbol.XmlName: exact.Symbol = ChartSymbol.ReadFrom(reader); break;

                            case GradientFillSymbol.XmlName: exact.Symbol = GradientFillSymbol.ReadFrom(reader); break;

                            case HashLineSymbol.XmlName: exact.Symbol = HashLineSymbol.ReadFrom(reader); break;

                            case RasterFillSymbol.XmlName: exact.Symbol = RasterFillSymbol.ReadFrom(reader); break;

                            case RasterMarkerSymbol.XmlName: exact.Symbol = RasterMarkerSymbol.ReadFrom(reader); break;

                            case RasterShieldSymbol.XmlName: exact.Symbol = RasterShieldSymbol.ReadFrom(reader); break;

                            case SimpleLineSymbol.XmlName: exact.Symbol = SimpleLineSymbol.ReadFrom(reader); break;

                            case SimpleMarkerSymbol.XmlName: exact.Symbol = SimpleMarkerSymbol.ReadFrom(reader); break;

                            case SimplePolygonSymbol.XmlName: exact.Symbol = SimplePolygonSymbol.ReadFrom(reader); break;

                            case ShieldSymbol.XmlName: exact.Symbol = ShieldSymbol.ReadFrom(reader); break;

                            case TextSymbol.XmlName: exact.Symbol = TextSymbol.ReadFrom(reader); break;

                            case TrueTypeMarkerSymbol.XmlName: exact.Symbol = TrueTypeMarkerSymbol.ReadFrom(reader); break;
                            }
                        }

                        reader.Read();
                    }
                }

                return(exact);
            }
            catch (Exception ex)
            {
                if (ex is ArcXmlException)
                {
                    throw ex;
                }
                else
                {
                    throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex);
                }
            }
        }