public MarkdownType BuildType(MarkdownType type, MarkdownNamespace namespaceItem, IEnumerable <XmlDocumentComment> comments) { Constants.Logger?.LogTrace("Building Markdown Item for Type {typeName}", type.Name); MarkdownRepo.TryAdd(type); type.NamespaceItem = namespaceItem; type.Summary = comments.FirstOrDefault(x => x.MemberName == type.Name || x.MemberName.StartsWith(type.Name))?.Summary ?? ""; Constants.Logger?.LogTrace("Getting Markdown Fields for Type {typeName}", type.Name); BuildFields(type, comments, type.GetFields().Together(type.GetStaticFields()).ToArray()); Constants.Logger?.LogTrace("Getting Markdown Properties for Type {typeName}", type.Name); BuildProperties(type, comments, type.GetProperties().Together(type.GetStaticProperties()).ToArray()); Constants.Logger?.LogTrace("Getting Markdown Methods for Type {typeName}", type.Name); BuildMethods(type, comments, type.GetMethods().Together(type.GetStaticMethods()).ToArray()); Constants.Logger?.LogTrace("Getting Markdown Events for Type {typeName}", type.Name); BuildEvents(type, comments, type.GetEvents().Together(type.GetStaticEvents()).ToArray()); Constants.Logger?.LogTrace("Getting Markdown Constructors for Type {typeName}", type.Name); BuildConstructors(type, comments, type.GetConstructors().Together(type.GetStaticConstructors()).ToArray()); Constants.Logger?.LogTrace("Completed Building Markdown Type {typeName}", type.Name); return(type); }
public void BuildConstructors(MarkdownType type, IEnumerable <XmlDocumentComment> comments, MarkdownConstructor[] infos) { Constants.Logger?.LogTrace("Found {itemCount} Markdown Constructors for Type {typeName}", infos.Length, type.Name); foreach (var item in infos) { item.ParentType = type; type.Constructors.Add(item); MarkdownRepo.TryAdd(item); item.Summary = comments.FirstOrDefault(x => ConstructorCommentFilter(x, item))?.Summary ?? ""; } }
public void BuildProperties(MarkdownType type, IEnumerable <XmlDocumentComment> comments, MarkdownProperty[] infos) { Constants.Logger?.LogTrace("Found {itemCount} Markdown Properties for Type {typeName}", infos.Length, type.Name); foreach (var item in infos) { item.ParentType = type; type.Properties.Add(item); MarkdownRepo.TryAdd(item); item.Summary = comments.FirstOrDefault(x => x.MemberName == item.Name || x.MemberName.StartsWith(item.Name + "`"))?.Summary ?? ""; } }
public void BuildMethods(MarkdownType type, IEnumerable <XmlDocumentComment> comments, MarkdownMethod[] infos) { Constants.Logger?.LogTrace("Found {itemCount} Markdown Comments for Type {typeName}", infos.Length, type.Name); var memberComments = comments.Where(c => c.MemberType == MemberType.Method); foreach (var item in infos) { item.ParentType = type; type.Methods.Add(item); MarkdownRepo.TryAdd(item); item.Summary = memberComments.Where(mc => mc.MemberName == item.InternalItem.GetCommentName()).FirstOrDefault(a => MethodCommentFilter(a, item))?.Summary ?? ""; } }
public MarkdownEnum BuildEnum(MarkdownType type, MarkdownNamespace namespaceItem, IEnumerable <XmlDocumentComment> comments) { Constants.Logger?.LogTrace("Building Markdown Item for Enum {enumName}", type.Name); MarkdownEnum me = new MarkdownEnum(); me.NamespaceItem = namespaceItem; me.InternalType = type.InternalType; me.Comments = comments; me.Summary = comments.FirstOrDefault(x => x.MemberName == me.Name || x.MemberName.StartsWith(me.Name + "`"))?.Summary ?? ""; MarkdownRepo.TryAdd(me); Constants.Logger?.LogTrace("Completed Building Markdown Enum {typeName}", me.Name); return(me); }