--- source_files: - 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 generated_at: "2026-04-17T15:36:54.153860+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "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() where T : class` | Retrieves a single MEF export of type `T`. Returns `null` if no export exists. | | `public static T GetPlugin(string configPluginSetting) where T : class` | Retrieves a specific plugin from multiple exports by matching `configPluginSetting` against the plugin's `ToString()` value. | | `public static IEnumerable> GetPlugins() 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 GetPluginList() 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"`