/// <summary> /// Initializes a new instance of the <see cref="TableOfContents" /> class. /// </summary> /// <param name="b">The source.</param> public TableOfContents(ReportItem b) { this.Base = b; this.Contents = new List<ContentItem>(); this.Fields.Add(new ItemsTableField(null, "Chapter")); this.Fields.Add(new ItemsTableField(null, "Title")); this.Items = this.Contents; }
public Content(ReportItem b) { this.Base = b; Class = "content"; Contents = new List<ContentItem>(); Columns.Add(new TableColumn(null, "Chapter")); Columns.Add(new TableColumn(null, "Title")); Items = Contents; }
private void Search(ReportItem item, HeaderHelper hh) { var h = item as Header; if (h != null) { h.Chapter = hh.GetHeader(h.Level); Contents.Add(new ContentItem() { Chapter = h.Chapter, Title = h.Text }); } foreach (var c in item.Children) Search(c,hh); }
/// <summary> /// Appends headers (recursively) to the <see cref="Contents" /> of the object. /// </summary> /// <param name="item">The item.</param> /// <param name="hh">The header formatter.</param> private void AppendHeaders(ReportItem item, HeaderHelper hh) { var h = item as Header; if (h != null) { h.Chapter = hh.GetHeader(h.Level); this.Contents.Add(new ContentItem { Chapter = h.Chapter, Title = h.Text }); } foreach (var c in item.Children) { this.AppendHeaders(c, hh); } }
/// <summary> /// Adds a report item to the report. /// </summary> /// <param name="child"> /// The child. /// </param> public void Add(ReportItem child) { this.Children.Add(child); }
/// <summary> /// The add table of contents. /// </summary> /// <param name="b"> /// The b. /// </param> public void AddTableOfContents(ReportItem b) { this.Add(new TableOfContents(b)); }