Exemplo n.º 1
0
        public static CT_OfficeStyleSheet Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_OfficeStyleSheet ctObj = new CT_OfficeStyleSheet();

            ctObj.name       = XmlHelper.ReadString(node.Attributes["name"]);
            ctObj.custClrLst = new List <CT_CustomColor>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "themeElements")
                {
                    ctObj.themeElements = CT_BaseStyles.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "objectDefaults")
                {
                    ctObj.objectDefaults = CT_ObjectStyleDefaults.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "extraClrSchemeLst")
                {
                    if (ctObj.extraClrSchemeLst == null)
                    {
                        ctObj.extraClrSchemeLst = new List <CT_ColorSchemeAndMapping>();
                    }
                    ctObj.extraClrSchemeLst.Add(CT_ColorSchemeAndMapping.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "custClrLst")
                {
                    ctObj.custClrLst.Add(CT_CustomColor.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Exemplo n.º 2
0
 public ThemeDocument(CT_OfficeStyleSheet stylesheet)
 {
     this.stylesheet = stylesheet;
 }
Exemplo n.º 3
0
 public static CT_OfficeStyleSheet Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_OfficeStyleSheet ctObj = new CT_OfficeStyleSheet();
     ctObj.name = XmlHelper.ReadString(node.Attributes["name"]);
     ctObj.extraClrSchemeLst = new List<CT_ColorSchemeAndMapping>();
     ctObj.custClrLst = new List<CT_CustomColor>();
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "themeElements")
             ctObj.themeElements = CT_BaseStyles.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "objectDefaults")
             ctObj.objectDefaults = CT_ObjectStyleDefaults.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "extLst")
             ctObj.extLst = CT_OfficeArtExtensionList.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "extraClrSchemeLst")
             ctObj.extraClrSchemeLst.Add(CT_ColorSchemeAndMapping.Parse(childNode, namespaceManager));
         else if (childNode.LocalName == "custClrLst")
             ctObj.custClrLst.Add(CT_CustomColor.Parse(childNode, namespaceManager));
     }
     return ctObj;
 }