The client program

A simple program which leverages the DOM is given next. We create a TDocument object as a top-level node, and add the rest of the document contents as child nodes to the respective classes:

 static void DocumentRender() { TDocument ds = new TDocument(3); ds.Title = "Multiplication Table"; TDocumentTable table = new TDocumentTable(); table.Border = 1; table.Width = 100; table.BackgroundColor = "#EFEEEC"; TDocumentTableRow row = null; row = new TDocumentTableRow(); TDocumentText headtxt = new TDocumentText("Multiplicand"); headtxt.Font = true; headtxt.Color = "#800000"; TDocumentTableCell cell = null; cell = new TDocumentTableCell(alignment.HEADING); cell.addObject(headtxt); row.addObject(cell); headtxt = new TDocumentText("Multiplier"); ...

Get .NET Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.