FileTopicFactory.Register Method

Namespace
Kampute.DocToolkit
Assembly
  • Kampute.DocToolkit.dll

Definition

Registers a topic type for the specified file extensions with the specified factory delegate.
public static void Register<TTopic>(Func<string, string, TTopic> factory, params IEnumerable<string> fileExtensions)
	where TTopic : FileTopic

Type Parameters

TTopic
The type of the topic to register.

Parameters

factory Func<string, string, TTopic>
A factory delegate that creates a new instance of the topic. The first parameter is the topic identifier, and the second is the file path.
fileExtensions IEnumerable<string>
The file extensions (including the leading period) to register the topic type for.

Exceptions

ArgumentNullException
Thrown when factory or fileExtensions is null.