public static RasterRenderer ReadFrom(ArcXmlReader reader) { try { RasterRenderer rasterRenderer = new RasterRenderer(); if (!reader.IsEmptyElement) { reader.Read(); while (!(reader.NodeType == XmlNodeType.EndElement && reader.Name == XmlName)) { if (reader.NodeType == XmlNodeType.Element) { switch (reader.Name) { case RasterExact.XmlName: rasterRenderer.Classifications.Add(RasterExact.ReadFrom(reader)); break; case RasterRange.XmlName: rasterRenderer.Classifications.Add(RasterRange.ReadFrom(reader)); break; case RasterOther.XmlName: rasterRenderer.Classifications.Add(RasterOther.ReadFrom(reader)); break; } } reader.Read(); } } return(rasterRenderer); } catch (Exception ex) { if (ex is ArcXmlException) { throw ex; } else { throw new ArcXmlException(String.Format("Could not read {0} element.", XmlName), ex); } } }