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();
        }
Beispiel #2
0
		private void ShowProviders()
		{

			foreach (ArrayList each in ProvidersByType)
			{
				// Lay down the header
				NamespaceProviderDefinition first = (NamespaceProviderDefinition)(each[0]);
				string s = first.Type;
				if (first.AssemblyName != null)
					s += " (in " + first.AssemblyName + ")";
				UIResponse.WriteHeading(UIResponse.Escape(s), 1);

				UITable table = new UITable();
				table.AddColumn(new UIColumn()); // edit link
				foreach (NamespaceProviderParameter parm in first.Parameters)
					table.AddColumn(new UIColumn(parm.Name));

				UIResponse.WriteStartTable(table);
				foreach (NamespaceProviderDefinition inner in each)
				{
					UIResponse.WriteStartRow();
					UIResponse.WriteCell(UIResponse.CommandLink("EditProvider.aspx?Provider=" + inner.Id, Command.Edit, "edit this provider's information"));
					foreach (NamespaceProviderParameter parm in inner.Parameters)
						UIResponse.WriteCell(UIResponse.Escape(parm.Value));
					UIResponse.WriteEndRow();
				}
				UIResponse.WriteEndTable();

			}
		}
Beispiel #3
0
        public string StartTable(UITable table)
        {
            StringBuilder b = new StringBuilder();
            b.Append("<table  class='GenericTable' cellpadding='2' cellspacing='0' border='0'>");
            b.Append("<tr class='GenericHeaderRow'>");
            if (table != null)
            {
                foreach (UIColumn each in table.Columns)
                {
                    string cls;
                    if (each.Name == null)
                        cls = "class='GenericEmptyHeaderCell'";
                    else
                        cls = "class='GenericHeaderCell'";

                    b.Append("<td " + cls + ">" + Escape(each.Name, false) +"</td>");
                }
                b.Append("</tr>");
            }
            return b.ToString();
        }
Beispiel #4
0
 public void WriteStartTable(UITable table)
 {
     Write(StartTable(table));
 }
Beispiel #5
0
		void ShowFederationInfo(Federation aFederation)
		{
			LinkMaker lm = new LinkMaker(RootUrl(Request));

			UIResponse.WritePara(UIResponse.Bold("General Federation Information"));
			UIResponse.WriteStartKVTable();
			UIResponse.WriteKVRow("Created", HTMLWriter.Escape(aFederation.Created.ToString()));
			UIResponse.WriteKVRow("Default Namespace", HTMLWriter.Escape(aFederation.DefaultNamespace.ToString()));
			UIResponse.WriteEndKVTable();

			UIResponse.WriteDivider();

			UIResponse.WritePara(UIResponse.Bold("Namespace Information"));

			UITable namespacesTable = new UITable();
			namespacesTable.AddColumn(new UIColumn("Namespace"));
			namespacesTable.AddColumn(new UIColumn("Title"));
			namespacesTable.AddColumn(new UIColumn("Imports"));

			UIResponse.WriteStartTable(namespacesTable);
			foreach (ContentBase each in aFederation.ContentBases)
			{
				UIResponse.WriteStartRow();

				string ns = each.Namespace;
				UIResponse.WriteCell(
					UIResponse.Bold(
						UIResponse.Link(lm.LinkToTopic(new AbsoluteTopicName(each.HomePage, each.Namespace), false), 
							UIResponse.Escape(each.Namespace))));

				UIResponse.WriteCell(HTMLWriter.Escape(each.Title));

				string imports = "";
				foreach (string e in each.ImportedNamespaces)
				{
					if (imports != "")
						imports += ", ";
					imports += e;
				}

				UIResponse.WriteCell(HTMLWriter.Escape(imports));

				UIResponse.WriteEndRow();

			}
			UIResponse.WriteEndTable();
		}