init
This commit is contained in:
48
docs/ai/DataPRO/DataPRO.Core/PluginLib.md
Normal file
48
docs/ai/DataPRO/DataPRO.Core/PluginLib.md
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/DataPRO.Core/PluginLib/PluginConfigData.cs
|
||||
- DataPRO/DataPRO.Core/PluginLib/PluginConfig.cs
|
||||
- DataPRO/DataPRO.Core/PluginLib/PluginConfigSectionHandler.cs
|
||||
- DataPRO/DataPRO.Core/PluginLib/PluginManager.cs
|
||||
generated_at: "2026-04-17T15:38:45.565653+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "4a5da7eb91c3d413"
|
||||
---
|
||||
|
||||
# PluginLib Module Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
The `PluginLib` module provides a Managed Extensibility Framework (MEF)-based plugin system for the DataPRO application. It handles discovery, loading, and retrieval of plugins from configurable directories, supporting both single and multiple plugin exports of the same type. The module implements a thread-safe singleton pattern for plugin management and integrates with the application's configuration system.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### `PluginManager` Class
|
||||
|
||||
The primary class for interacting with the plugin system.
|
||||
|
||||
| Method | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `GetPluginManager` | `public static PluginManager GetPluginManager()` | Returns the singleton instance of `PluginManager`. Thread-safe via lock. |
|
||||
| `GetPlugin<T>` | `public static T GetPlugin<T>() where T : class` | Returns a single MEF plugin export of type `T`. Returns `null` if no export exists. |
|
||||
| `GetPlugin<T>` | `public static T GetPlugin<T>(string configPluginSetting) where T : class` | Returns a specific plugin from multiple exports by matching `item.Value.ToString()` against `configPluginSetting`. |
|
||||
| `GetPlugins<T>` | `public static IEnumerable<Lazy<T>> GetPlugins<T>() where T : class` | Returns all MEF plugin exports of type `T` as `Lazy<T>` instances. |
|
||||
| `GetPluginList<T>` | `public List<Assembly> GetPlugin<T>() where T : class` | Returns a list of distinct assemblies from the first `DirectoryCatalog` found. Returns `null` if no directory catalog exists. |
|
||||
|
||||
### `PluginConfig` Class (Static)
|
||||
|
||||
Configuration helper for plugin settings.
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| `DataProPlugins` | `public const string DataProPlugins = "dataProPlugins"` | Constant for the app setting key name. |
|
||||
| `GetDataProPluginsSetting` | `public static string GetDataProPluginsSetting(string setting)` | Concatenates the app setting value from `DataProPlugins` key with `.` + `setting`. |
|
||||
|
||||
### `PluginConfigData` Class
|
||||
|
||||
XML-serializable configuration data class.
|
||||
|
||||
| Field | Type |
|
||||
Reference in New Issue
Block a user