Ejemplo n.º 1
0
        /// <inheritdoc />
        public void GenerateTableOfContents(TocEntryCollection toc, bool includeInvisibleItems)
        {
            TocEntry entry;

            foreach (Topic t in this)
            {
                if (t.Visible || includeInvisibleItems)
                {
                    entry = new TocEntry((t.TopicFile != null) ? t.TopicFile.ContentFile.BasePathProvider : null);

                    if (t.TopicFile != null)
                    {
                        entry.SourceFile      = new FilePath(t.TopicFile.FullPath, t.TopicFile.ContentFile.BasePathProvider);
                        entry.DestinationFile = "html\\" + t.Id + ".htm";
                    }

                    entry.Id             = t.Id;
                    entry.PreviewerTitle = !String.IsNullOrEmpty(t.Title) ? t.Title :
                                           Path.GetFileNameWithoutExtension(t.TopicFilename);
                    entry.LinkText       = String.IsNullOrEmpty(t.LinkText) ? t.DisplayTitle : t.LinkText;
                    entry.Title          = t.DisplayTitle;
                    entry.IsDefaultTopic = t.IsDefaultTopic;
                    entry.ApiParentMode  = t.ApiParentMode;
                    entry.IsExpanded     = t.IsExpanded;
                    entry.IsSelected     = t.IsSelected;

                    if (t.Subtopics.Count != 0)
                    {
                        t.Subtopics.GenerateTableOfContents(entry.Children, includeInvisibleItems);
                    }

                    toc.Add(entry);
                }
            }
        }
Ejemplo n.º 2
0
 /// <inheritdoc />
 /// <remarks>The <paramref name="includeInvisibleItems"/> parameter is ignored as site maps do not
 /// support them.</remarks>
 public void GenerateTableOfContents(TocEntryCollection toc, bool includeInvisibleItems)
 {
     foreach (TocEntry t in this)
     {
         toc.Add(t);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Generate the table of contents for the conceptual topics
        /// </summary>
        /// <param name="toc">The table of contents collection</param>
        /// <param name="pathProvider">The base path provider</param>
        public void GenerateTableOfContents(TocEntryCollection toc,
                                            IBasePathProvider pathProvider)
        {
            TocEntry entry;

            foreach (Topic t in this)
            {
                if (t.Visible)
                {
                    entry = new TocEntry(pathProvider);

                    if (t.TopicFile != null)
                    {
                        entry.SourceFile = new FilePath(t.TopicFile.FullPath,
                                                        t.TopicFile.FileItem.ProjectElement.Project);
                        entry.DestinationFile = "html\\" + t.Id + ".htm";
                    }

                    entry.Id             = t.Id;
                    entry.Title          = t.DisplayTitle;
                    entry.IsDefaultTopic = t.IsDefaultTopic;
                    entry.ApiParentMode  = t.ApiParentMode;

                    if (t.Subtopics.Count != 0)
                    {
                        t.Subtopics.GenerateTableOfContents(entry.Children, pathProvider);
                    }

                    toc.Add(entry);
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// This is used to merge this TOC with another one
 /// </summary>
 /// <param name="toc">The table of contents collection</param>
 /// <param name="pathProvider">The base path provider</param>
 public void GenerateTableOfContents(TocEntryCollection toc,
                                     IBasePathProvider pathProvider)
 {
     foreach (TocEntry t in this)
     {
         toc.Add(t);
     }
 }
Ejemplo n.º 5
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="basePathProvider">The base path provider</param>
        public TocEntry(IBasePathProvider basePathProvider)
        {
            pathProvider   = basePathProvider;
            this.SortOrder = Int32.MaxValue;
            children       = new TocEntryCollection();
            sourceFile     = new FilePath(pathProvider);

            children.ListChanged += childList_ListChanged;
        }
Ejemplo n.º 6
0
        /// <inheritdoc />
        /// <remarks>The <paramref name="includeInvisibleItems"/> parameter is ignored as site maps do not
        /// support them.</remarks>
        public void GenerateTableOfContents(TocEntryCollection toc, bool includeInvisibleItems)
        {
            if (toc == null)
            {
                throw new ArgumentNullException(nameof(toc));
            }

            foreach (TocEntry t in this)
            {
                toc.Add(t);
            }
        }