public static ElementFootprint Create(XElement element) { if (element == null) { return(null); } ElementFootprint item = new ElementFootprint(); foreach (XAttribute attribute in element.Attributes()) { switch (attribute.Name.LocalName) { case "name": item.name = attribute.Value; break; case "uid": item.uid = ReaderUtil.ConvertGuid(attribute.Value, Guid.Empty); break; } } item.Items = (from Element in element.Elements(ElementPin.Name) select ElementPin.Create(Element) ).ToArray(); return(item); }
public static ElementFootprints Create(XElement element) { ElementFootprints item = new ElementFootprints(); item.ItemDic = (from Element in element.Elements(ElementFootprint.Name) select ElementFootprint.Create(Element) ).ToDictionary(x => x.name); return(item); }