FileTopicFactory Class

Namespace
Kampute.DocToolkit
Assembly
  • Kampute.DocToolkit.dll

Definition

Provides methods for creating appropriate FileTopic instances based on file extensions.
public static class FileTopicFactory
Inheritance

Remarks

The FileTopicFactory class serves as a central registry for topic type selection, allowing the system to dynamically create appropriate FileTopic instances based on file extensions.

This class:
  • Manages associations between file extensions and topic type implementations
  • Provides factory methods to create topic instances on demand
  • Supports registration of custom topic types for specific file formats
  • Allows for overriding default topic types with custom implementations
The system comes pre-configured with topic types for common documentation formats (HTML and Markdown), but applications can register additional topic types or replace the built-in ones as needed.

Methods

Create(string)Creates a topic instance based on the specified file path, using the file name (without extension) as the topic name.
Create(string, string)Creates a topic instance with the specified name based on the specified file path.
IsRegistered(string)Determines whether a specialized topic type is registered for the specified file extension.
Register<TTopic>(Func<string, string, TTopic>, IEnumerable<string>)Registers a topic type for the specified file extensions with the specified factory delegate.
Unregister<TTopic>()Unregisters a topic type for all associated file extensions.
Unregister(string)Unregisters a topic type for the specified file extension.

See Also