FileTopicHelper.ConstructHierarchyByIndexFile Method
- Namespace
- Kampute.DocToolkit.Support
- Assembly
- Kampute.DocToolkit.dll
Definition
Organizes file-backed topics into a hierarchy where index files become parent topics for other files in the same directory.
public static IEnumerable<FileTopic> ConstructHierarchyByIndexFile(IEnumerable<FileTopic> topics, string indexFileName)Parameters
topicsIEnumerable<FileTopic>- The collection of file-backed topics to organize.
indexFileNamestring- The file name (without extension) that identifies index files.
Returns
- IEnumerable<FileTopic>
- An enumerable collection of FileTopic instances that represent the top-level topics in the hierarchy.
Exceptions
- ArgumentNullException
- Thrown when
topicsisnullor contains anulltopic. - ArgumentException
- Thrown when
indexFileNameisnull, empty, or whitespace.

Files in directories that contain only one file or lack an index file are not assigned parent relationships.
Example file structure with
indexFileName = "index":