Table of Contents

Class EngineRegistry

Namespace
Virtufin.WorkManager.Runtime
Assembly
Virtufin.WorkManager.dll

Registry for managing engine instances.

public sealed class EngineRegistry : IEngineRegistry
Inheritance
EngineRegistry
Implements
Inherited Members

Methods

GetEngine(ContentType)

Gets an engine instance for the given content type.

public 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.

public 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.

public 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.

public bool Unregister(ContentType contentType)

Parameters

contentType ContentType

The content type to unregister.

Returns

bool

true if an engine was unregistered; otherwise, false.