public override void LoadDetails(XmlNode node, KmlRoot owner) { base.LoadDetails(node, owner); if (node["outerBoundaryIs"] != null) { if (node["outerBoundaryIs"]["LinearRing"] != null) { OuterBoundary = new KmlLinearRing(); OuterBoundary.LoadDetails(node["outerBoundaryIs"]["LinearRing"], owner); } } foreach(XmlNode child in node.ChildNodes) { if (child.Name == "innerBoundaryIs") { KmlLinearRing innerRing = new KmlLinearRing(); innerRing.LoadDetails(child, owner); InnerBoundarys.Add(innerRing); } } if (node["extrude"] != null) { extrude = node["extrude"].InnerText.Trim() == "1"; } if (node["altitudeMode"] != null) { altitudeMode = (altitudeModeEnum)Enum.Parse(typeof(altitudeModeEnum), node["altitudeMode"].InnerText.Trim()); } }
public override void LoadDetails(XmlNode node, KmlRoot owner) { base.LoadDetails(node, owner); foreach (XmlNode child in node.ChildNodes) { KmlGeometry geometry = null; switch (child.Name) { case "Point": { geometry = new KmlPoint(); geometry.LoadDetails(child, owner); } break; case "LineString": { geometry = new KmlLineString(); geometry.LoadDetails(child, owner); } break; case "LinearRing": { geometry = new KmlLinearRing(); geometry.LoadDetails(child, owner); } break; case "Polygon": { geometry = new KmlPolygon(); geometry.LoadDetails(child, owner); } break; case "MultiGeometry": { geometry = new KmlMultiGeometry(); geometry.LoadDetails(child, owner); } break; } if (geometry != null) { Children.Add(geometry); } } if (node["extrude"] != null) { extrude = node["extrude"].InnerText.Trim() == "1"; } if (node["altitudeMode"] != null) { altitudeMode = (altitudeModeEnum)Enum.Parse(typeof(altitudeModeEnum), node["altitudeMode"].InnerText.Trim()); } }