public static ElementPoint Create(XElement element) { if (element == null) { return(null); } ElementPoint item = new ElementPoint(); foreach (XAttribute attribute in element.Attributes()) { switch (attribute.Name.LocalName) { case "x": item.x = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break; case "y": item.y = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break; } } return(item); }
public static ElementDrawPath Create(XElement element) { if (element == null) { return(null); } ElementDrawPath item = new ElementDrawPath(); foreach (XAttribute attribute in element.Attributes()) { switch (attribute.Name.LocalName) { case "area": item.area = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break; } } item.pt = (from Element in element.Elements(ElementPoint.Name) select ElementPoint.Create(Element) ).ToArray(); return(item); }