Ejemplo n.º 1
0
        public static CT_ObjectStyleDefaults Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_ObjectStyleDefaults ctObj = new CT_ObjectStyleDefaults();

            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "spDef")
                {
                    ctObj.spDef = CT_DefaultShapeDefinition.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "lnDef")
                {
                    ctObj.lnDef = CT_DefaultShapeDefinition.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "txDef")
                {
                    ctObj.txDef = CT_DefaultShapeDefinition.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Ejemplo n.º 2
0
        public static CT_OfficeStyleSheet Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_OfficeStyleSheet ctObj = new CT_OfficeStyleSheet();

            ctObj.name = XmlHelper.ReadString(node.Attribute("name"));
            ctObj.extraClrSchemeLst = new List <CT_ColorSchemeAndMapping>();
            ctObj.custClrLst        = new List <CT_CustomColor>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "themeElements")
                {
                    ctObj.themeElements = CT_BaseStyles.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "objectDefaults")
                {
                    ctObj.objectDefaults = CT_ObjectStyleDefaults.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extraClrSchemeLst")
                {
                    ctObj.extraClrSchemeLst.Add(CT_ColorSchemeAndMapping.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "custClrLst")
                {
                    ctObj.custClrLst.Add(CT_CustomColor.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }