FileTopicFactory.Create Method

Namespace
Kampute.DocToolkit
Assembly
  • Kampute.DocToolkit.dll
FileTopicFactory.Create(string)Creates a topic instance based on the specified file path, using the file name (without extension) as the topic name.
FileTopicFactory.Create(string, string)Creates a topic instance with the specified name based on the specified file path.

FileTopicFactory.Create(string)

Creates a topic instance based on the specified file path, using the file name (without extension) as the topic name.
public static FileTopic Create(string filePath)

Parameters

filePath string
The path to the file that contains the topic content.

Returns

FileTopic
An instance of a FileTopic or its derived class appropriate for the file extension.

Exceptions

ArgumentException
Thrown when filePath is null or whitespace, or does not have a valid file name.

FileTopicFactory.Create(string, string)

Creates a topic instance with the specified name based on the specified file path.
public static FileTopic Create(string id, string filePath)

Parameters

id string
The unique identifier of the topic among its siblings, typically used for URLs or filenames.
filePath string
The path to the file that contains the topic content.

Returns

FileTopic
An instance of a FileTopic or its derived class appropriate for the file extension.

Exceptions

ArgumentException
Thrown when id or filePath is null, whitespace, or id contains invalid characters.
FileNotFoundException
Thrown when the file specified by filePath does not exist.