Пример #1
0
        public String GetDocumentation(ColumnDescriptor columnDescriptor)
        {
            StringWriter stringWriter = new StringWriter();

            stringWriter.WriteLine("<table><tr><th>Name</th><th>Description</th><th>Type</th>");
            foreach (var child in GetChildColumns(columnDescriptor))
            {
                var columnCaption = DataSchema.GetColumnCaption(child);
                stringWriter.Write("<tr><td class=\"ColumnCaption\">" + HtmlEncode(columnCaption.GetCaption(DataSchema.DataSchemaLocalizer)) + "</td>");
                stringWriter.Write("<td class=\"ColumnDescription\">");
                String tooltip = DataSchema.GetColumnDescription(child);
                stringWriter.Write(HtmlEncode(tooltip));
                stringWriter.Write("</td>");
                stringWriter.Write("<td class=\"ColumnType\">");
                stringWriter.Write(GetHtmlForType(child.PropertyType));
                stringWriter.Write("</td>");
                stringWriter.WriteLine("</tr>");
                if (IsNestedColumn(child))
                {
                    stringWriter.WriteLine("<tr><td>&nbsp;</td><td colspan=\"2\">");
                    stringWriter.WriteLine(GetDocumentation(child));
                    stringWriter.WriteLine("</td></tr>");
                }
            }
            stringWriter.WriteLine("</table>");
            return(stringWriter.ToString());
        }
Пример #2
0
        public String GetDocumentation(ColumnDescriptor columnDescriptor)
        {
            StringWriter stringWriter = new StringWriter();

            stringWriter.WriteLine("<table><tr><th>Name</th><th>Description</th><th>Type</th>");
            foreach (var child in GetChildColumns(columnDescriptor))
            {
                List <string> captionClasses = new List <string> {
                    @"ColumnCaption"
                };
                if (DataSchema.IsHidden(child))
                {
                    if (!IncludeHidden)
                    {
                        continue;
                    }

                    if (DataSchema.IsObsolete(child))
                    {
                        captionClasses.Add(@"Obsolete");
                    }
                    else
                    {
                        captionClasses.Add(@"Hidden");
                    }
                }

                string captionClass  = string.Join(" ", captionClasses);
                var    columnCaption = DataSchema.GetColumnCaption(child);

                stringWriter.Write("<tr><td class=\"" + captionClass + "\">" +
                                   HtmlEncode(columnCaption.GetCaption(DataSchema.DataSchemaLocalizer)) + "</td>");
                stringWriter.Write("<td class=\"ColumnDescription\">");
                String tooltip = DataSchema.GetColumnDescription(child);
                stringWriter.Write(HtmlEncode(tooltip));
                stringWriter.Write("</td>");
                stringWriter.Write("<td class=\"ColumnType\">");
                stringWriter.Write(GetHtmlForType(child.PropertyType));
                stringWriter.Write("</td>");
                stringWriter.WriteLine("</tr>");
                if (IsNestedColumn(child))
                {
                    stringWriter.WriteLine("<tr><td>&nbsp;</td><td colspan=\"2\">");
                    stringWriter.WriteLine(GetDocumentation(child));
                    stringWriter.WriteLine("</td></tr>");
                }
            }
            stringWriter.WriteLine("</table>");
            return(stringWriter.ToString());
        }