public static HashLineSymbol ReadFrom(ArcXmlReader reader) { try { HashLineSymbol hashLineSymbol = new HashLineSymbol(); if (reader.HasAttributes) { while (reader.MoveToNextAttribute()) { string value = reader.ReadContentAsString(); if (value.Length > 0) { switch (reader.Name) { case "antialiasing": hashLineSymbol.Antialiasing = Convert.ToBoolean(value); break; case "color": hashLineSymbol.Color = ColorConverter.ToColor(value); break; case "interval": hashLineSymbol.Interval = Convert.ToInt32(value); break; case "linethickness": hashLineSymbol.LineThickness = Convert.ToInt32(value); break; case "tickthickness": hashLineSymbol.TickThickness = Convert.ToInt32(value); break; case "overlap": hashLineSymbol.Overlap = Convert.ToBoolean(value); break; case "transparency": hashLineSymbol.Transparency = Convert.ToDouble(value); break; case "type": hashLineSymbol.Type = (HashLineType)ArcXmlEnumConverter.ToEnum(typeof(HashLineType), value); break; case "width": hashLineSymbol.Width = Convert.ToInt32(value); break; } } } reader.MoveToElement(); } return(hashLineSymbol); } catch (Exception ex) { if (ex is ArcXmlException) { throw ex; } else { throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex); } } }
public static SimpleRenderer ReadFrom(ArcXmlReader reader) { try { SimpleRenderer simpleRenderer = new SimpleRenderer(); if (!reader.IsEmptyElement) { reader.Read(); while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName)) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name) { case HashLineSymbol.XmlName: simpleRenderer.Symbol = HashLineSymbol.ReadFrom(reader); break; case SimpleLineSymbol.XmlName: simpleRenderer.Symbol = SimpleLineSymbol.ReadFrom(reader); break; case SimpleMarkerSymbol.XmlName: simpleRenderer.Symbol = SimpleMarkerSymbol.ReadFrom(reader); break; case SimplePolygonSymbol.XmlName: simpleRenderer.Symbol = SimplePolygonSymbol.ReadFrom(reader); break; case TrueTypeMarkerSymbol.XmlName: simpleRenderer.Symbol = TrueTypeMarkerSymbol.ReadFrom(reader); break; } } reader.Read(); } } return(simpleRenderer); } catch (Exception ex) { if (ex is ArcXmlException) { throw ex; } else { throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex); } } }
public static Other ReadFrom(ArcXmlReader reader) { try { Other other = new Other(); if (reader.HasAttributes) { while (reader.MoveToNextAttribute()) { string value = reader.ReadContentAsString(); if (value.Length > 0) { switch (reader.Name) { case "label": other.Label = 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 HashLineSymbol.XmlName: other.Symbol = HashLineSymbol.ReadFrom(reader); break; case SimpleLineSymbol.XmlName: other.Symbol = SimpleLineSymbol.ReadFrom(reader); break; case SimpleMarkerSymbol.XmlName: other.Symbol = SimpleMarkerSymbol.ReadFrom(reader); break; case SimplePolygonSymbol.XmlName: other.Symbol = SimplePolygonSymbol.ReadFrom(reader); break; case ShieldSymbol.XmlName: other.Symbol = ShieldSymbol.ReadFrom(reader); break; case TextSymbol.XmlName: other.Symbol = TextSymbol.ReadFrom(reader); break; case TrueTypeMarkerSymbol.XmlName: other.Symbol = TrueTypeMarkerSymbol.ReadFrom(reader); break; } } reader.Read(); } } return(other); } 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() { HashLineSymbol clone = (HashLineSymbol)this.MemberwiseClone(); return(clone); }
public static Range ReadFrom(ArcXmlReader reader) { try { Range range = new Range(); if (reader.HasAttributes) { while (reader.MoveToNextAttribute()) { string value = reader.ReadContentAsString(); if (value.Length > 0) { switch (reader.Name) { case "equality": range.Equality = (RangeEquality)ArcXmlEnumConverter.ToEnum(typeof(RangeEquality), value); break; case "label": range.Label = value; break; case "lower": range.Lower = value; break; case "upper": range.Upper = 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 HashLineSymbol.XmlName: range.Symbol = HashLineSymbol.ReadFrom(reader); break; case SimpleLineSymbol.XmlName: range.Symbol = SimpleLineSymbol.ReadFrom(reader); break; case SimpleMarkerSymbol.XmlName: range.Symbol = SimpleMarkerSymbol.ReadFrom(reader); break; case SimplePolygonSymbol.XmlName: range.Symbol = SimplePolygonSymbol.ReadFrom(reader); break; case ShieldSymbol.XmlName: range.Symbol = ShieldSymbol.ReadFrom(reader); break; case TextSymbol.XmlName: range.Symbol = TextSymbol.ReadFrom(reader); break; case TrueTypeMarkerSymbol.XmlName: range.Symbol = TrueTypeMarkerSymbol.ReadFrom(reader); break; } } reader.Read(); } } return(range); } catch (Exception ex) { if (ex is ArcXmlException) { throw ex; } else { throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex); } } }
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); } } }