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

            ctObj.color = XmlHelper.ReadString(node.Attribute("w:color"));
            if (node.Attribute("w:themeColor") != null)
            {
                ctObj.themeColor = (ST_ThemeColor)Enum.Parse(typeof(ST_ThemeColor), node.Attribute("w:themeColor").Value);
            }
            ctObj.themeTint  = XmlHelper.ReadBytes(node.Attribute("w:themeTint"));
            ctObj.themeShade = XmlHelper.ReadBytes(node.Attribute("w:themeShade"));

            return(ctObj);
        }
Example #2
0
        public static CT_Document Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Document ctObj = new CT_Document();

            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "body")
                {
                    ctObj.body = CT_Body.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "background")
                {
                    ctObj.background = CT_Background.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }