コード例 #1
0
ファイル: Content.cs プロジェクト: jwolfm98/HardwareMonitor
 public override void Update()
 {
     Contents.Clear();
     var hh = new HeaderHelper();
     Search(Base, hh);
     base.Update();
 }
コード例 #2
0
 /// <summary>
 /// Updates the table of contents.
 /// </summary>
 public override void Update()
 {
     this.Contents.Clear();
     var hh = new HeaderHelper();
     this.AppendHeaders(this.Base, hh);
     base.Update();
 }
        /// <summary>
        /// The update.
        /// </summary>
        public override void Update()
        {
            this.Contents.Clear();
            var hh = new HeaderHelper();

            this.Search(this.Base, hh);
            base.Update();
        }
コード例 #4
0
ファイル: Content.cs プロジェクト: jwolfm98/HardwareMonitor
 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);
 }
コード例 #5
0
        /// <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>
        /// The search.
        /// </summary>
        /// <param name="item">
        /// The item.
        /// </param>
        /// <param name="hh">
        /// The hh.
        /// </param>
        private void Search(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.Search(c, hh);
            }
        }