Ejemplo n.º 1
0
                public static ElementPackagePins Create(XElement element)
                {
                    if (element == null)
                    {
                        return(null);
                    }

                    ElementPackagePins item = new ElementPackagePins();

                    item.pkgpin
                        = (from Element in element.Elements(ElementPackagePin.Name)
                           select ElementPackagePin.Create(Element)
                           ).ToArray();

                    return(item);
                }
Ejemplo n.º 2
0
            public static ElementPackage Create(XElement element)
            {
                if (element == null)
                {
                    return(null);
                }

                ElementPackage item = new ElementPackage();

                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;

                    case "type": item.type = attribute.Value; break;

                    case "pkgInspGroup": item.pkgInspGroup = attribute.Value; break;

                    case "maker": item.maker = attribute.Value; break;

                    case "pkgApplyLevel": item.pkgApplyLevel = ReaderUtil.ConvertInt32(attribute.Value, 0); break;

                    case "fOrgOffsetAng": item.fOrgOffsetAng = ReaderUtil.ConvertInt32(attribute.Value, 0); break;
                    }
                }

                item.pkgbody
                    = (from Element in element.Elements(ElementPackageBody.Name)
                       select ElementPackageBody.Create(Element)
                       ).ToArray();
                item.pkgpins
                    = (from Element in element.Elements(ElementPackagePins.Name)
                       select ElementPackagePins.Create(Element)
                       ).ToArray();
                return(item);
            }