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

            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "numFmts")
                {
                    ctObj.numFmts = CT_NumFmts.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "fonts")
                {
                    ctObj.fonts = CT_Fonts.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "fills")
                {
                    ctObj.fills = CT_Fills.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "borders")
                {
                    ctObj.borders = CT_Borders.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "cellStyleXfs")
                {
                    ctObj.cellStyleXfs = CT_CellStyleXfs.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "cellXfs")
                {
                    ctObj.cellXfs = CT_CellXfs.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "cellStyles")
                {
                    ctObj.cellStyles = CT_CellStyles.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "dxfs")
                {
                    ctObj.dxfs = CT_Dxfs.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "tableStyles")
                {
                    ctObj.tableStyles = CT_TableStyles.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "colors")
                {
                    ctObj.colors = CT_Colors.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst = CT_ExtensionList.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
예제 #2
0
        public static CT_Fonts Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Fonts ctObj = new CT_Fonts();

            ctObj.count = XmlHelper.ReadUInt(node.Attribute("count"));
            ctObj.font  = new List <CT_Font>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "font")
                {
                    ctObj.font.Add(CT_Font.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }