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
contentTypeContentTypeThe content type to get an engine for.
Returns
- IEngine
A new engine instance, or
nullif 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
contentTypeContentTypeThe content type handled by the engine.
languageNamestringThe name of the programming language.
engineFactoryFunc<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
contentTypeContentTypeThe content type to unregister.
Returns
- bool
trueif an engine was unregistered; otherwise,false.