private static void _GenerateMarkdown(StringBuilder builder, MethodInfo method, IList <Tag> tags) { var link = LinkCache.GetLink(method.GetLinkKey()); builder.Header(3, link.Markdown); _GenerateMarkdown(builder, tags, "summary"); if (method.IsGenericMethod) { var generic = method.GetGenericMethodDefinition(); var typeParamTags = tags.OfType <TypeParamTag>().ToList(); foreach (var parameter in generic.GetGenericArguments()) { _GenerateMarkdown(builder, parameter, typeParamTags); } } var paramTags = tags.OfType <ParamTag>().ToList(); foreach (var parameter in method.GetParameters()) { _GenerateMarkdown(builder, parameter, paramTags); } var tag = tags.FirstOrDefault(t => t.Name == "returns"); if (tag == null) { return; } tag.Handled = true; builder.Paragraph($"**Returns:** {tag.Text}"); }
private static void _GenerateMarkdown(StringBuilder builder, EventInfo @event, IList <Tag> tags) { var link = LinkCache.GetLink(@event.GetLinkKey()); builder.Header(3, link.Markdown); _GenerateMarkdown(builder, tags, "summary"); }
private static void _GenerateMarkdown(StringBuilder builder, ConstructorInfo constructor, List <Tag> tags) { var link = LinkCache.GetLink(constructor.GetLinkKey()); builder.Header(3, link.Markdown); _GenerateMarkdown(builder, tags, "summary"); var paramTags = tags.OfType <ParamTag>().ToList(); foreach (var parameter in constructor.GetParameters()) { _GenerateMarkdown(builder, parameter, paramTags); } }
private static void _GenerateMarkdown(StringBuilder builder, PropertyInfo property, IList <Tag> tags) { var link = LinkCache.GetLink(property.GetLinkKey()); builder.Header(3, link.Markdown); _GenerateMarkdown(builder, tags, "summary"); var indexes = property.GetIndexParameters(); if (!indexes.Any()) { return; } foreach (var index in indexes) { _GenerateMarkdown(builder, index, tags.OfType <ParamTag>()); } }