private void WriteMarkdownTitle(TextWriter tw, bool appendAllDeclarations, ChangeType nestedChange) { RootDetail namedItem; if (appendAllDeclarations) { namedItem = FindItemWithStatusPresent(); } else { namedItem = this; } string name; if (namedItem == null || namedItem.Status == Status.Missing) { name = Name; } else { name = namedItem.GetTextTitle(); } string nestedChangeText = ChangeTypeUtil.GetSummaryText(nestedChange); tw.WriteLine("----"); tw.WriteLine(); tw.Write($"### {name}"); if (nestedChangeText != null) { tw.Write($" *{nestedChangeText}*"); } tw.WriteLine(); tw.WriteLine(); }
public virtual void WriteHtmlDescription(TextWriter tw, bool appendAllDeclarations, bool appendChildren) { ChangeType nestedChange = CalculateNestedChanges(); string changeClass = ChangeTypeUtil.GetChangeClass(nestedChange); tw.Write("<div class='item"); if (changeClass != null) { tw.Write(' '); tw.Write(changeClass); } tw.WriteLine("'>"); if (!this.ExcludeFromReport) { FilterStatus filterThisInstance; if (appendAllDeclarations) { filterThisInstance = GetStrongestFilterStatus(); if (this.CollapseChildren && filterThisInstance == FilterStatus.ExcludedButIncludeForChildren) { filterThisInstance = FilterStatus.Include; } } else { filterThisInstance = FilterStatus.Include; } if ((!appendChildren) || (filterThisInstance >= FilterStatus.DontCare)) { string nestedChangeText = ChangeTypeUtil.GetSummaryText(nestedChange); tw.Write("<h2>"); if (nestedChangeText != null) { tw.Write("<span class='item-change'>"); tw.Write(HtmlUtility.HtmlEncode(nestedChangeText)); tw.Write("</span>"); } RootDetail namedItem; if (appendAllDeclarations) { namedItem = FindItemWithStatusPresent(); } else { namedItem = this; } tw.Write("<span class='name'>"); if ((namedItem == null) || (namedItem.Status == Status.Missing)) { tw.Write(this.Name); } else { tw.Write(HtmlUtility.HtmlEncode(namedItem.GetTextTitle())); } tw.Write("</span>"); tw.Write("</h2>"); tw.Write("<div class='item-body'>"); RootDetail eachItem = this; while (eachItem != null) { tw.Write("<div class='item-entry'>"); eachItem.WriteHtmlDeclaration(tw); eachItem.WriteHtmlSummaryForChange(tw); tw.Write("</div>"); eachItem = appendAllDeclarations ? (RootDetail)eachItem.NavigateForward : null; } tw.WriteLine("</div>"); } } if (appendChildren && !this.ExcludeChildrenFromReport) { foreach (RootDetail child in FilterChildrenInAll <RootDetail>()) { // if ((child.FullNameRoot) || (child.GetStrongestFilterStatus() != FilterStatus.ExcludedButIncludeForChildren)) // Dont include public stuff inside internal classes for -publiconly { child.WriteHtmlDescription(tw, appendAllDeclarations, appendChildren); } } } tw.WriteLine("</div>"); }