This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
---
source_files:
- DataPRO/DataPRO.Core/Config/DataProConfig.cs
generated_at: "2026-04-17T16:11:20.599916+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "c85bf33b30f4fe33"
---
# Config
### Purpose
This module provides centralized access to a custom application configuration file, abstracting away the details of `System.Configuration`. It exists to allow the application to read settings from a non-default config file path defined by `DataProConstants.CustomConfigPath`, enabling configuration separation from the main executable.
### Public Interface
**`DataProConfig` (static class)**
- `static Configuration AltConfig { get; }` — Returns the `Configuration` object mapped to the custom config file. Useful for advanced configuration operations not covered by helper methods.
- `static string GetAppSetting(string key)` — Retrieves an application setting value by key from the `<appSettings>` section. Returns `String.Empty` if the key is not found.
- `static object GetSection(string sectionName)` — Retrieves a named configuration section from the config file. Used by plugin code to access custom sections.
### Invariants
- The static constructor runs exactly once, before any member is accessed.
- `Config` is initialized via `ConfigurationManager.OpenMappedExeConfiguration` with `ConfigurationUserLevel.None` and will never be null after static construction.
- `GetAppSetting` always returns a non-null string (empty string if key missing).
- The configuration file path is determined by `DataProConstants.CustomConfigPath` and cannot be changed at runtime.
### Dependencies
- **Depends on**: `System.Configuration`, `DataProConstants` (specifically `DataProConstants.CustomConfigPath`).
- **Depended on by**: Unknown from source alone—likely consumed by plugin code and core application components requiring configuration access.
### Gotchas
- If `DataProConstants.CustomConfigPath` points to a non-existent or malformed config file, the static constructor will throw an exception, rendering the entire class unusable for the application lifetime.
- `GetAppSetting` performs a linear search through `Config.AppSettings.Settings` using LINQ; performance may degrade with very large numbers of settings.
- The third parameter `true` passed to `OpenMappedExeConfiguration` is undocumented in the source context—it appears to be a boolean for "preload" behavior, but its exact effect is unclear from source alone.
---

View File

@@ -0,0 +1,49 @@
---
source_files:
- DataPRO/DataPRO.Core/EventManager/EventManager.cs
generated_at: "2026-04-17T16:11:20.602481+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "bb36e013f0f39c56"
---
# EventManager
### Purpose
This module implements a type-safe, loosely-coupled publish/subscribe event system. It allows components to communicate without direct references to each other, supporting filtered subscriptions and diagnostic monitoring of event flow. This decouples publishers from subscribers and centralizes event routing.
### Public Interface
**`EventManager` (static class)**
- `static void Publish<T>(T eventData) where T : class` — Publishes an event to all subscribers of type `T`. If no subscribers exist, returns immediately. Each subscriber's filter (if present) is evaluated before invoking the callback.
- `static void Subscribe<T>(SubscriberCallbackDelegate<T> listener) where T : class` — Subscribes to events of type `T` without a filter.
- `static void Subscribe<T>(SubscriberCallbackDelegate<T> listener, Predicate<T> eventFilter) where T : class` — Subscribes to events of type `T` with a filter predicate. The callback is only invoked when the filter returns `true`.
- `static void UnSubscribe<T>(SubscriberCallbackDelegate<T> listener) where T : class` — Removes all subscriptions matching the given listener delegate.
- `static void Clear()` — Removes all subscribers from all event types.
- `static void SubscribeToDiagnosticEvents(DiagnosticCallbackDelegate listener)` — Registers a callback to receive diagnostic events about the event system itself.
- `static void UnSubscribeToDiagnosticEvents(DiagnosticCallbackDelegate listener)` — Removes a diagnostic listener.
- `static void ClearDiagnosticEvents()` — Removes all diagnostic listeners.
**`SubscriberCallbackDelegate<in T>` (delegate)**
- `void SubscriberCallbackDelegate<in T>(T item) where T : class` — The signature for event callbacks.
**`DiagnosticCallbackDelegate` (delegate)**
- `void DiagnosticCallbackDelegate(EventDiagnosticType eventType, Type t, object eventData, string listener)` — The signature for diagnostic callbacks.
**`EventDiagnosticType` (enum)**
- Values: `AddListener = 0`, `AddListenerDiagnostic = 1`, `PublishEvent = 2`, `RemoveListenerDiagnostic = 3`, `RemoveListener = 4`
### Invariants
- `SubscriberList` and `DiagnosticList` are never null (initialized inline).
- `Publish<T>` silently does nothing if no subscribers exist for type `T`.
- Subscribers are stored in insertion order; callbacks are invoked in that order during `Publish`.
- `UnSubscribe<T>` removes all matching entries (not just the first).
- `EventMetaData<T>` is internal and always contains a non-null `Callback` after construction.
### Dependencies
- **Depends on**: `System`, `System.Collections.Generic`, `System.Reflection`.
- **Depended on by**: Unknown from source alone—likely used throughout the application for cross-component communication.
### Gotchas
- Subscribers hold references to callbacks. If a subscriber fails to call `UnSubscribe`, the callback (and potentially its capturing object) will not be garbage collected, causing memory leaks.
- `Publish` iterates over `listeners` directly; if a callback modifies the subscriber list (e.g., by calling `Subscribe` or `UnSubscribe`), behavior is undefined (likely an exception or skipped

View 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 |

View File

@@ -0,0 +1,35 @@
---
source_files:
- DataPRO/DataPRO.Core/Properties/AssemblyInfo.cs
generated_at: "2026-04-17T16:28:03.040571+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "117dfebe92b0ea1c"
---
# Properties
### Purpose
This module contains assembly-level metadata configuration for the DataPro.Core assembly. It defines standard .NET assembly attributes including title, version information, COM visibility settings, and a unique GUID for type library identification. This is a standard .NET Framework assembly information file.
### Public Interface
No public types or functions are exposed. This module consists solely of assembly-level attributes:
- `AssemblyTitle`: "DataPro.Core"
- `AssemblyProduct`: "DataPro.Core"
- `AssemblyVersion`: "1.0.0.0"
- `AssemblyFileVersion`: "1.0.0.0"
- `ComVisible`: false
- `Guid`: "bdf5ad7a-51db-4ad0-8186-d1ead7405848"
### Invariants
- Assembly version is fixed at "1.0.0.0" for both assembly and file versions.
- COM visibility is disabled for all types in this assembly.
- The GUID "bdf5ad7a-51db-4ad0-8186-d1ead7405848" uniquely identifies this assembly's type library.
### Dependencies
**Depends on:**
- `System.Reflection`
- `System.Runtime.CompilerServices`
- `System.Runtime.InteropServices`
**

View File

@@ -0,0 +1,33 @@
---
source_files:
- DataPRO/DataPRO.Core/ServiceManager/IServicePublishedEvent.cs
- DataPRO/DataPRO.Core/ServiceManager/ServicePublishedEvent.cs
- DataPRO/DataPRO.Core/ServiceManager/ServiceManager.cs
generated_at: "2026-04-17T16:36:18.703341+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5cab21cff0e733cd"
---
# ServiceManager Module Documentation
## 1. Purpose
The ServiceManager module implements a service locator pattern, enabling decoupled component communication within the application. It allows components to publish implementations of singleton interfaces (services) that other components can retrieve without direct knowledge of the publisher. The module provides event-driven notification when services are published or unpublished, supporting reactive architectures where consumers need to respond to service availability changes.
---
## 2. Public Interface
### ServiceManager (Static Class)
A static service locator that manages a registry of interface-to-implementation mappings.
| Method | Signature | Description |
|--------|-----------|-------------|
| `Publish<T>` | `void Publish<T>(T item) where T : class` | Publishes a service implementation under its interface type `T`. Throws `ArgumentException` if the type is already published. |
| `Publish` | `void Publish(object item, IEnumerable<Type> interfaceList, bool skipPublishedInterfaces)` | Publishes a single object under multiple interface types. If `skipPublishedInterfaces` is `true`, silently skips already-published interfaces; otherwise throws `ArgumentException`. |
| `Exists<T>` | `bool Exists<T>() where T : class` | Returns `true` if interface type `T` has been published; otherwise `false`. |
| `Exists` | `bool Exists(Type t)` | Non-generic overload. Returns `true` if the specified type has been published; otherwise `false`. |
| `Get<T>` | `T Get<T>() where T : class` | Retrieves the published service for interface type `T`. Throws `ArgumentException` if not published. |
| `Clear<T>` | `void Clear<T>() where T : class` | Unpublishes the service for interface type `T`. Silently does nothing if the type is not

View File

@@ -0,0 +1,54 @@
---
source_files:
- DataPRO/DataPRO.Core/Settings/SettingsChangedEventArgs.cs
- DataPRO/DataPRO.Core/Settings/SettingsCollection.cs
generated_at: "2026-04-17T15:42:20.133577+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "19770357354d5bed"
---
# Documentation: DataPRO.Core.Settings
## 1. Purpose
This module provides an observable dictionary implementation for application settings management. The `SettingsCollection<TKey, TItem>` class wraps a standard `Dictionary<TKey, TItem>` and raises events when items are added, removed, modified, or when the collection is cleared. This enables consumers to react to configuration changes in real-time without polling. The module is designed to serve as the foundation for a settings system where UI components or services need to be notified when preferences change.
---
## 2. Public Interface
### `SettingsCollection<TKey, TItem>`
A generic dictionary implementation that implements `IDictionary<TKey, TItem>` with change notification.
#### Events
| Signature | Description |
|-----------|-------------|
| `event EventHandler<SettingsChangedEventArgs<TKey, TItem>> CollectionItemPropertyChanged` | Fired after any mutation operation (add, remove, modify, clear). Event args contain the change type and optionally the key/item involved. |
#### Constructors
The class provides only the default parameterless constructor (inherited from `Object`).
#### Methods
| Signature | Description |
|-----------|-------------|
| `void Add(TKey key, TItem value)` | Adds a key-value pair to the collection. Fires `CollectionItemPropertyChanged` with `ChangeSettingType.Add`. |
| `void Add(KeyValuePair<TKey, TItem> item)` | Adds a key-value pair via `KeyValuePair`. Fires `CollectionItemPropertyChanged` with `ChangeSettingType.Add`. |
| `bool Remove(TKey key)` | Removes the item with the specified key. Returns `true` if removed; fires event with `ChangeSettingType.Remove` only on success. |
| `bool Remove(KeyValuePair<TKey, TItem> item)` | Removes by `KeyValuePair.Key` (value is ignored). Fires event with `ChangeSettingType.Remove` only on success. |
| `void Clear()` | Removes all items. Fires `CollectionItemPropertyChanged` with `ChangeSettingType.ClearAll`. |
| `bool ContainsKey(TKey key)` | Returns `true` if the key exists. |
| `bool Contains(KeyValuePair<TKey, TItem> item)` | Returns `true` if both key and value match an entry in the collection. |
| `bool TryGetValue(TKey key, out TItem value)` | Attempts to retrieve the value for the given key. Returns `false` if key not found. |
| `IEnumerator<KeyValuePair<TKey, TItem>> GetEnumerator()` | Returns an enumerator over the collection. |
| `void CopyTo(KeyValuePair<TKey, TItem>[] array, int arrayIndex)` | **Throws `NotImplementedException`**. |
#### Properties
| Signature | Description |
|-----------|-------------|
| `TItem this[TKey key]` (getter) | Returns the value associated with the key. Throws `KeyNotFoundException` if key absent.