Table of Contents

Interface IEngineRegistry

Namespace
Virtufin.WorkManager.Contracts
Assembly
Virtufin.WorkManager.dll

Provides mechanisms for registering and retrieving engine instances based on content type.

public interface IEngineRegistry

Methods

GetEngine(ContentType)

Gets an engine instance for the given content type.

IEngine? GetEngine(ContentType contentType)

Parameters

contentType ContentType

The content type to get an engine for.

Returns

IEngine

A new engine instance, or null if no engine is registered.

ListEngines()

Lists all registered engines.

IReadOnlyList<EngineInfo> ListEngines()

Returns

IReadOnlyList<EngineInfo>

A read-only list of engine information.

Register(ContentType, string, Func<IEngine>)

Registers an engine factory for a given content type and language.

void Register(ContentType contentType, string languageName, Func<IEngine> engineFactory)

Parameters

contentType ContentType

The content type handled by the engine.

languageName string

The name of the programming language.

engineFactory Func<IEngine>

A factory function that creates new engine instances.

Exceptions

InvalidOperationException

Thrown if an engine is already registered for the content type.

Unregister(ContentType)

Unregisters the engine for a given content type.

bool Unregister(ContentType contentType)

Parameters

contentType ContentType

The content type to unregister.

Returns

bool

true if an engine was unregistered; otherwise, false.