Beispiel #1
0
 public void visit(TDocumentTableCell cell)
 {
     for (int i = 0; i < cell.DocumentElements.Count; ++i)
     {
         cell.DocumentElements[i].accept(this);
     }
 }
Beispiel #2
0
        public void visit(TDocumentTableCell cell)
        {
            StringBuilder CHTML  = new StringBuilder("");
            string        tag    = null;
            string        valign = null;
            string        align  = null;

            switch (cell.Vertical)
            {
            case alignment.TOP:
                valign = "TOP";
                break;

            case alignment.MIDDLE:
                valign = "MIDDLE";
                break;

            default:
                valign = "BOTTOM";
                break;
            }

            switch (cell.Horizontal)
            {
            case alignment.LEFT:
                align = "LEFT";
                break;

            case alignment.CENTER:
                align = "CENTER";
                break;

            default:
                align = "RIGHT";
                break;
            }

            if (cell.Type == alignment.DATA)
            {
                tag = "TD";
            }
            else
            {
                tag = "TH";
            }
            CHTML.Append("<" + tag + " VALIGN=" + valign + " ALIGN=" + align);
            CHTML.Append(" COLSPAN=" + cell.ColumnSpan + ">");
            document.Append(CHTML.ToString());

            for (int x = 0; x < cell.DocumentElements.Count; x++)
            {
                try
                {
                    ((TDocumentElement)cell.DocumentElements[x]).accept(this);
                }
                catch (Exception ex)
                {
                    Console.Error.WriteLine(ex.Message);
                }
            }
            document.Append("</" + tag + ">");
        }