/// <summary> /// Create a constructor with links and parameters /// </summary> /// <param name="currentItem">The current location to create this Constructor name with links</param> /// <param name="constructor">The constructor to clean up</param> /// <param name="useFullName">Use full name of the constructor</param> /// <param name="useParameterNames">Use parameter names if set to false only type will be shown</param> /// <returns>The markdown string</returns> public static string CreateFullConstructorsWithLinks(IMarkdownItem currentItem, MarkdownConstructor constructor, bool useFullName, bool useParameterNames) { var parameters = constructor.InternalItem.GetParameters(); MarkdownBuilder mb = new MarkdownBuilder(); string name = useFullName ? CleanFullName(constructor.ParentType.InternalType, false, false) : CleanName(constructor.ParentType.Name, false, false); if (constructor.FileName != null) { mb.Link(name, currentItem.To(constructor)); } else { mb.Append(name); } mb.Append(" ("); if (parameters.Length > 0) { StringBuilder sb = new StringBuilder(); for (var i = 0; i < parameters.Length; i++) { var type = parameters[i].ParameterType; var link = CreateFullTypeWithLinks(currentItem, type, useFullName, true); sb.Append(link); if (useParameterNames) { sb.Append($" {parameters[i].Name}"); } if (i + 1 != parameters.Length) { sb.Append(", "); } } mb.Append(sb.ToString()); } mb.Append(")"); return(mb.ToString()); }
/// <summary> /// Builds the page for a constructor item - Warning this is not yet implemented /// </summary> /// <param name="item">The constructor item</param> /// <returns></returns> public string BuildPage(MarkdownConstructor item) { MarkdownBuilder mb = new MarkdownBuilder(); return(mb.ToString()); }
private bool ConstructorCommentFilter(XmlDocumentComment comment, MarkdownConstructor constructor) { return(constructor.InternalItem.IsMatchOnMethod(comment)); }
/// <summary> /// In default theme this returns only "" /// </summary> /// <param name="item">The item to build a page with</param> /// <returns>An empty string</returns> public string BuildPage(MarkdownConstructor item) { return(""); }