public static ElementBoard Create(XElement element) { if (element == null) { return(null); } ElementBoard item = new ElementBoard(); foreach (XAttribute attribute in element.Attributes()) { switch (attribute.Name.LocalName) { case "name": item.name = attribute.Value; break; case "si": item.name = attribute.Value; break; case "w": item.w = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break; case "h": item.h = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break; case "rot": item.rot = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break; case "bBkImgRot": item.bBkImgRot = ReaderUtil.ConvertInt32(attribute.Value, 0); break; case "orgH": item.orgH = ReaderUtil.ConvertSingle(attribute.Value, 0.0f); break; } } return(item); }
public static ElementHeadInfo Create(XElement element) { if (element == null) { return(null); } ElementHeadInfo item = new ElementHeadInfo(); ElementBoard[] boards = (from Element in element.Elements(ElementBoard.Name) select ElementBoard.Create(Element) ).ToArray(); if (boards.Length > 0) { item.board = boards[0]; } return(item); }