Exemple #1
0
        public static CT_CustomGeometry2D Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_CustomGeometry2D ctObj = new CT_CustomGeometry2D();

            ctObj.ahLst = new List <Object>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "rect")
                {
                    ctObj.rect = CT_GeomRect.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "avLst")
                {
                    ctObj.avLst = CT_GeomGuideList.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "gdLst")
                {
                    ctObj.gdLst = CT_GeomGuideList.Parse(childNode, namespaceManager);
                }
                //else if (childNode.Name.LocalName == "ahLst")
                //    ctObj.ahLst.Add(Object.Parse(childNode, namespaceManager));
                else if (childNode.Name.LocalName == "cxnLst")
                {
                    ctObj.cxnLst = CT_ConnectionSiteList.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "pathLst")
                {
                    ctObj.pathLst = CT_Path2DList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Exemple #2
0
        public static CT_PresetGeometry2D Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_PresetGeometry2D ctObj = new CT_PresetGeometry2D();

            if (node.Attribute("prst") != null)
            {
                ctObj.prst = (ST_ShapeType)Enum.Parse(typeof(ST_ShapeType), node.Attribute("prst").Value);
            }
            if (node.ChildElements() != null)
            {
                foreach (XElement childNode in node.ChildElements())
                {
                    if (childNode.Name.LocalName == "avLst")
                    {
                        ctObj.avLstField = CT_GeomGuideList.Parse(childNode, namespaceManager);
                    }
                }
            }
            return(ctObj);
        }