예제 #1
0
        public static ElementShape Create(XElement element)
        {
            ElementShape item = new ElementShape();

            foreach (XAttribute attribute in element.Attributes())
            {
                switch (attribute.Name.LocalName)
                {
                case "uid": item.uid = ReaderUtil.ConvertGuid(attribute.Value, Guid.Empty); break;

                case "name": item.name = ReaderUtil.ConvertGuid(attribute.Value, Guid.Empty); break;
                }
            }

            item.rc
                = (from Element in element.Elements(ElementRect.Name)
                   select ElementRect.Create(Element)
                   ).ToArray();
            item.drawpath
                = (from Element in element.Elements(ElementDrawPath.Name)
                   select ElementDrawPath.Create(Element)
                   ).ToArray();

            return(item);
        }
예제 #2
0
        public static ElementFootprintLeadShapes Create(XElement element)
        {
            if (element == null)
            {
                return(null);
            }

            ElementFootprintLeadShapes item = new ElementFootprintLeadShapes();

            item.ItemDic
                = (from Element in element.Elements(ElementShape.Name)
                   select ElementShape.Create(Element)
                   ).ToDictionary(x => x.uid);
            return(item);
        }