void FieldHtml(Bootstrap4 content, int i, object value, XNetDocItem doc) { content.ListGroupItemOpen("justify-content-between" + (i % 2 == 0 ? " list-group-item-info" : null)); if (value is FieldProperties field) { content.ParagraphText($"{field.DataType} {field.Name}", "col-2"); content.Paragraph(doc?.Summary, "col-8"); content.ParagraphOpen("col-2"); if (field.StringEncoding != StringEncoding.Undefined) { content.Badge(field.StringEncoding.ToString(), "badge-primary badge-pill float-right"); } if (field.DataType == DataType.DateTime) { content.Badge(field.DateTimeKind.ToString(), "badge-danger badge-pill float-right"); content.Badge(field.DateTimeType.ToString(), "badge-danger badge-pill float-right"); } content.ParagraphClose(); } else { content.ParagraphText(value.ToString(), "col-2"); content.Paragraph(doc?.Summary, "col-8"); content.ParagraphOpen(); content.Badge(Convert.ToInt64(value).ToString(), "badge-default badge-pill"); content.ParagraphClose(); } content.ListGroupItemClose(); }
void ParameterHtml(Bootstrap4 content, int i, ParameterInfo parameter, XNetDocItem xMethodDoc) { content.ListGroupItemOpen("justify-content-between" + (i % 2 == 0 ? " list-group-item-info" : null)); string typeName = parameter.ParameterType.Name; if (parameter.ParameterType.Name == "Nullable`1") { typeName = parameter.ParameterType.GetGenericArguments().Last().Name; // typeName = parameter.ParameterType.GenericTypeArguments.Last().Name; } content.ParagraphText($"{typeName} {parameter.Name}", "col-sm-2 col-12"); { string doc = null; xMethodDoc?.Parameters.TryGetValue(parameter.Name, out doc); Paragraph("col-sm-8 col-12", content, doc, null); // content.ParagraphText(doc, "col-8"); } content.ParagraphOpen("col-sm-2 col-12"); if (parameter.IsOptional) { content.Badge("optional", "badge-primary badge-pill float-right"); } content.ParagraphClose(); content.ListGroupItemClose(); }