FileTopic Class

Namespace
Kampute.DocToolkit.Topics
Assembly
  • Kampute.DocToolkit.dll

Definition

Represents source of a documentation topic that reads content from a file.
public class FileTopic : ConvertibleTopic, IFileBasedTopic
Inheritance
Implements
Inherited by

Remarks

The FileTopic class serves as the foundation for file-backed documentation topics. It handles reading content from disk files and provides core functionality for deriving topic names and titles from file properties.

This class can be used directly, or extended for specialized file formats like Markdown or HTML through derived classes.

The constructor of the class does not validate the existence of the file at FilePath. It assumes that the file will be present when the content is read. If the file does not exist at the time of reading, an IOException will be thrown.

Thread Safety

Public static members of the type are guaranteed to be thread-safe. However, public instance members are not thread-safe.

Constructors

FileTopic(string, string)Initializes a new instance of the FileTopic class.

Properties

ContentFormatGets the format of the content in the topic.
FilePathGets the path to the file that contains the topic content.

Methods

CreateContentReader(IDocumentationContext)Creates a TextReader to read the content of the source file.

See Also