Пример #1
0
        private static IList <XMLRow> GetXmlRows(XmlNodeList rows, Dictionary <String, XMLObject> xmlObjectDic)
        {
            IList <XMLRow> xmlRows = new List <XMLRow>();

            foreach (XmlElement rowXe in rows)
            {
                XMLRow xmlRow = GetXmlRow(rowXe, xmlObjectDic);
                xmlRows.Add(xmlRow);
            }
            return(xmlRows);
        }
Пример #2
0
        private static XMLRow GetXmlRow(XmlElement rowXe, Dictionary <String, XMLObject> xmlObjectDic)
        {
            XMLRow xmlRow = new XMLRow();

            xmlRow.RowStartIndex = int.Parse(rowXe.GetAttribute("rowStartIndex"));
            if (rowXe.HasAttribute("rows"))
            {
                xmlRow.Rows = int.Parse(rowXe.GetAttribute("rows"));
            }
            string PageCount = rowXe.GetAttribute("PageCount");

            if (!"".Equals(PageCount))
            {
                xmlRow.PageCount = int.Parse(PageCount);
            }
            string cellTotal = rowXe.GetAttribute("cellTotal");

            if (!"".Equals(cellTotal))
            {
                xmlRow.CellTotal = int.Parse(cellTotal);
            }
            string rowStep = rowXe.GetAttribute("rowStep");

            if (!"".Equals(rowStep))
            {
                xmlRow.RowStep = int.Parse(rowStep);
            }
            else
            {
                xmlRow.RowStep = 1;
            }
            String writeIndex = rowXe.GetAttribute("WriteIndex");

            if (!"".Equals(writeIndex))
            {
                xmlRow.Index = int.Parse(writeIndex);
            }
            XmlNodeList cells = rowXe.GetElementsByTagName("cell");

            xmlRow.cellDic = GetXmlCellDic(cells, xmlObjectDic);

            //解析grop
            XmlNodeList groups = rowXe.GetElementsByTagName("group");

            xmlRow.XmlGroups = GetXmlGrougs(groups, xmlObjectDic);

            return(xmlRow);
        }