Example #1
0
        public override void Render(StringBuilder output)
        {
            // <table><tr><td>(cell_0_0)</td><td>(cell_0_1)</td>…</tr><tr><td>(cell_1_0)</td><td>(cell_1_1)</td>…</tr>…</table>
            //For each row its content is rendered enclosed between the <tr> and </tr> tags. For each column inside a row its element
            //content is rendered enclosed between the <td> and </td> tags.
            if (this.Name != null)
            {
                output.AppendFormat("<{0}>", this.Escape(this.Name));
            }

            for (int rows = 0; rows < this.Rows; rows++)
            {
                output.AppendFormat("<tr>");
                for (int cols = 0; cols < this.Cols; cols++)
                {
                    if (this.table[rows, cols] != null)
                    {
                        SimpleElement temp = (SimpleElement)this.table[rows, cols];
                        output.AppendFormat("<td><{0}></td>", this.Escape(temp.ToString()));
                    }
                }
                output.AppendFormat("</tr>");
            }
            if (this.name != null)
            {
                output.AppendFormat("</{0}>", this.Escape(this.Name));
            }
            output = output.Replace("<<", "<");
            output = output.Replace(">>", ">");
        }
Example #2
0
 public IElement CreateElement(string name, string content)
 {
     IElement element = new SimpleElement(name, content);
     return element;
 }
Example #3
0
 public IElement CreateElement(string name)
 {
     IElement element = new SimpleElement(name);
     return element;
 }
Example #4
0
        public IElement CreateElement(string name, string content)
        {
            IElement element = new SimpleElement(name, content);

            return(element);
        }