Table of Contents

Class LoaderRegistry

Namespace
Core.Loaders
Assembly
Core.dll

Registry for data loaders with auto-discovery. Discovers loaders via reflection and executes them in priority order.

Usage:

  1. Create registry instance
  2. Call DiscoverLoaders() with assemblies to scan
  3. Call ExecuteAll() to run loaders in priority order
public class LoaderRegistry
Inheritance
object
LoaderRegistry

Constructors

LoaderRegistry(string)

Create a loader registry.

public LoaderRegistry(string logSubsystem = "core_data_loading")

Parameters

logSubsystem string

Subsystem name for logging

Properties

Count

Get count of registered loaders.

public int Count { get; }

Property Value

int

Methods

DiscoverLoaders(params Assembly[])

Auto-discover and register all loader factories in specified assemblies.

public void DiscoverLoaders(params Assembly[] assemblies)

Parameters

assemblies Assembly[]

Assemblies to scan for ILoaderFactory implementations

ExecuteAll(LoaderContext)

Execute all registered loaders in priority order.

public bool ExecuteAll(LoaderContext context)

Parameters

context LoaderContext

Loading context with registries and settings

Returns

bool

True if all required loaders succeeded

GetAllLoaders()

Get all registered loaders in priority order.

public IEnumerable<LoaderRegistry.LoaderRegistration> GetAllLoaders()

Returns

IEnumerable<LoaderRegistry.LoaderRegistration>

GetLoadingSummary()

Get loading summary.

public string GetLoadingSummary()

Returns

string

RegisterFactory(ILoaderFactory, LoaderMetadataAttribute)

Manually register a loader factory instance with metadata.

public bool RegisterFactory(ILoaderFactory factory, LoaderMetadataAttribute metadata)

Parameters

factory ILoaderFactory
metadata LoaderMetadataAttribute

Returns

bool

RegisterFactory(Type)

Manually register a loader factory type.

public bool RegisterFactory(Type factoryType)

Parameters

factoryType Type

Returns

bool

TryGetLoader(string, out LoaderRegistration)

Try to get loader registration by name.

public bool TryGetLoader(string name, out LoaderRegistry.LoaderRegistration registration)

Parameters

name string
registration LoaderRegistry.LoaderRegistration

Returns

bool