public static GradientFillSymbol ReadFrom(ArcXmlReader reader) { try { GradientFillSymbol gradientFillSymbol = new GradientFillSymbol(); if (reader.HasAttributes) { while (reader.MoveToNextAttribute()) { string value = reader.ReadContentAsString(); if (value.Length > 0) { switch (reader.Name) { case "antialiasing": gradientFillSymbol.Antialiasing = Convert.ToBoolean(value); break; case "finishcolor": gradientFillSymbol.FinishColor = ColorConverter.ToColor(value); break; case "overlap": gradientFillSymbol.Overlap = Convert.ToBoolean(value); break; case "startcolor": gradientFillSymbol.StartColor = ColorConverter.ToColor(value); break; case "transparency": gradientFillSymbol.Transparency = Convert.ToDouble(value); break; case "type": gradientFillSymbol.Type = (GradientFillType)ArcXmlEnumConverter.ToEnum(typeof(GradientFillType), value); break; } } } reader.MoveToElement(); } return(gradientFillSymbol); } catch (Exception ex) { if (ex is ArcXmlException) { throw ex; } else { throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex); } } }
public override object Clone() { GradientFillSymbol clone = (GradientFillSymbol)this.MemberwiseClone(); return(clone); }
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); } } }