public void WriteTo(HtmlWriter writer) { UITable t = new UITable(); UIColumn color = new UIColumn(); t.AddColumn(color); UIColumn text = new UIColumn("Description"); writer.WriteStartTable(t); foreach (Result each in Results) { string bg = null; switch (each.ResultLevel) { case Level.OK: bg = "lightgreen"; break; case Level.Info: bg = "lightgreen"; break; case Level.Warning: bg = "yellow"; break; case Level.Error: bg = "red"; break; } writer.WriteStartRow(); writer.Write("<td valign='top' bgcolor=" + bg + "> </td>"); writer.Write("<td valign='top' class='GenericCell' bgcolor='#e0e0e0'>" + writer.Bold(HtmlStringWriter.Escape(each.Title)) + "</td>"); writer.WriteEndRow(); writer.WriteStartRow(); writer.Write("<td valign='top' bgcolor=" + bg + "> </td>"); writer.WriteCell(text, each.Writer.ToString()); writer.WriteEndRow(); } writer.WriteEndTable(); }
public void AddColumn(UIColumn col) { Columns.Add(col); }
public string Cell(UIColumn col, string contents) { return StartCell(col) + contents + " " + EndCell(); }
public void WriteStartCell(UIColumn col) { Write(StartCell(col)); }
public void WriteCell(UIColumn col, string contents) { Write(Cell(col, contents)); }
public string StartCell(UIColumn col) { return "<td class='GenericCell' valign='top'>"; }