TopicSource Class

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

Definition

Provides the base functionality for a topic source.
public abstract class TopicSource : IMutableTopic
Inheritance
Implements
Inherited by

Remarks

The TopicSource class implements the ITopic interface and provides a base for creating different types of topic sources, such as file-backed or dynamic topics.

The class allows for the management of topic name, title, and parent-child relationships between topics. The subclass can override the Render(TextWriter, IDocumentationContext) method to provide custom rendering logic for the topic's content.

Thread Safety

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

Constructors

TopicSource(string)Initializes a new instance of the TopicSource class.

Properties

IdGets the unique identifier of the topic among its siblings.
ParentTopicGets or sets the parent topic of the topic.
SubtopicsGets the collection of subtopics of the topic.
TitleGets or sets the title of the topic.

Methods

AddSubtopic(IMutableTopic)Adds a subtopic to the current topic.
GenerateTitle()Generates the title of the topic based on its name or content.
RemoveSubtopic(IMutableTopic)Removes a subtopic from the current topic.
Render(TextWriter, IDocumentationContext)Renders the content of the topic to the specified TextWriter.
ToString()Returns a string that represents the current object.
WouldCreateCircularReference(IMutableTopic)Checks if adding the specified topic as a subtopic would create a circular reference.

Explicit Interface Implementations

ITopic.ParentTopicGets the parent topic of the topic.
ITopic.TitleGets the title of the topic.