Files
DP44/docs/ai/Common/DTS.Common.Core/PluginLib.md
2026-04-17 14:55:32 -04:00

2.0 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.Common.Core/PluginLib/PluginConfigData.cs
Common/DTS.Common.Core/PluginLib/PluginConfig.cs
Common/DTS.Common.Core/PluginLib/PluginConfigSectionHandler.cs
Common/DTS.Common.Core/PluginLib/PluginManager.cs
2026-04-17T15:36:54.153860+00:00 zai-org/GLM-5-FP8 1 9804f9dd2a12c0c7

PluginLib Module Documentation

1. Purpose

The PluginLib module provides a Managed Extensibility Framework (MEF)-based plugin system for the DTS application. It handles discovery, loading, and retrieval of plugins from configurable directories, supporting both single-plugin resolution and multiple implementations of the same contract. The module implements a thread-safe singleton pattern to manage the plugin catalog and container lifecycle.


2. Public Interface

PluginManager (Class)

The primary entry point for plugin operations.

Properties:

  • AggregateCatalog PluginCatalog { get; set; } — The MEF aggregate catalog containing all loaded plugin catalogs.

Methods:

Signature Description
public static T GetPlugin<T>() where T : class Retrieves a single MEF export of type T. Returns null if no export exists.
public static T GetPlugin<T>(string configPluginSetting) where T : class Retrieves a specific plugin from multiple exports by matching configPluginSetting against the plugin's ToString() value.
public static IEnumerable<Lazy<T>> GetPlugins<T>() where T : class Returns all MEF exports of type T as lazy-initialized references.
public static PluginManager GetPluginManager(string appPath) Returns the singleton instance of PluginManager. Initializes the manager on first call with the provided appPath.
public List<Assembly> GetPluginList<T>() where T : class Returns a list of distinct assemblies from all loaded directory catalogs.

PluginConfig (Static Class)

Stores plugin configuration constants and helpers.

Constants:

  • public const string DTSPlugins = "DTSPlugins"