Пример #1
0
        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 + ">&nbsp;&nbsp;</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 + ">&nbsp;&nbsp;</td>");
                writer.WriteCell(text, each.Writer.ToString());
                writer.WriteEndRow();
            }

            writer.WriteEndTable();
        }
Пример #2
0
 public void AddColumn(UIColumn col)
 {
     Columns.Add(col);
 }
Пример #3
0
 public string Cell(UIColumn col, string contents)
 {
     return StartCell(col) + contents + "&nbsp;" + EndCell();
 }
Пример #4
0
 public void WriteStartCell(UIColumn col)
 {
     Write(StartCell(col));
 }
Пример #5
0
 public void WriteCell(UIColumn col, string contents)
 {
     Write(Cell(col, contents));
 }
Пример #6
0
 public string StartCell(UIColumn col)
 {
     return "<td class='GenericCell' valign='top'>";
 }