Пример #1
0
        private TableCell BuildTableCell(XmlNode node, XmlAttributeCollection fontAttrs)
        {
            TableCell tableCell = new TableCell(node.Attributes, fontAttrs);
            BuildTableCellChildElement(tableCell, node, fontAttrs);

            return tableCell;
        }
Пример #2
0
        /// <summary>
        /// 20130612 :: Add custom element.
        /// </summary>
        /// <param name="tableCell"></param>
        /// <param name="tableCellNode"></param>
        /// <param name="fontAttrs"></param>
        private void BuildTableCellChildElement(
            TableCell tableCell,
            XmlNode tableCellNode,
            XmlAttributeCollection fontAttrs)
        {
            foreach (XmlNode child in tableCellNode.ChildNodes)
            {
                switch (child.Name)
                {
                    case "textbox":
                        tableCell.AddDrawElement(pdfTemplate.BuildTextBox(child, fontAttrs));
                        break;
                    case "image":
                        tableCell.AddDrawElement(pdfTemplate.BuildImage(child, fontAttrs));
                        break;
                    //20130612 :: mellorasinxelas :: custom
                    case PDFTemplate.PDFTemplate.CustomElementConstant:
                        tableCell.AddDrawElement(pdfTemplate.BuildCustomElement(child, fontAttrs));
                        break;

                }
                if (child.Name == "font" && child.HasChildNodes)
                {
                    BuildTableCellChildElement(tableCell, child, child.Attributes);
                }
            }
        }
Пример #3
0
		/// <summary>
		/// Add a new table cell
		/// </summary>
		/// <param name="tableCell"></param>
		public void AddTableCell(TableCell tableCell)
		{
			tableCells.Add(tableCell);
		}