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,103 @@
---
source_files:
- DataPRO/Modules/SystemSettings/DBImportExport/DBImportExportModule.cs
generated_at: "2026-04-16T04:39:22.157742+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "148ddc7b73c8539d"
---
# DBImportExport
## Documentation: DBImportExportModule
---
### 1. Purpose
The `DBImportExportModule` is a Prism module responsible for registering the views, view models, and related UI components for database import/export functionality within the application. It integrates with the Unity dependency injection container to expose `IDBImportView`, `IDBExportView`, and `IDBViewModel` as singleton registrations, enabling modular loading of the database import/export UI layer. Additionally, it contributes metadata (via `DBImageAttribute`) used by the main UI to display the modules icon, name, and group on the main component selection screen.
---
### 2. Public Interface
#### `DBImportExportModule`
- **`DBImportExportModule(IUnityContainer unityContainer)`**
Constructor. Accepts and stores a Unity container reference via dependency injection. Used to register types during initialization.
- **`void Initialize()`**
Registers three types as singletons in the Unity container:
- `IDBImportView → DBImportView`
- `IDBExportView → DBExportView`
- `IDBViewModel → DBViewModel`
This method is called both directly by the constructors usage context (via `RegisterTypes`) and potentially by Prisms module initialization pipeline.
- **`void OnInitialized(IContainerProvider containerProvider)`**
Currently empty; no logic implemented.
- **`void RegisterTypes(IContainerRegistry containerRegistry)`**
Delegates to `Initialize()`, which performs the actual Unity registration. Note: Although the parameter is `IContainerRegistry`, the implementation uses the injected `IUnityContainer`, implying a mismatch between Prisms `IContainerRegistry` and Unitys `IUnityContainer`—this may indicate legacy or hybrid DI usage.
#### `DBImageAttribute`
- **`DBImageAttribute()`**
Default constructor; delegates to `DBImageAttribute(string)` with `null`.
- **`DBImageAttribute(string s)`**
Constructor accepting a string (unused in implementation); loads and stores the assembly image via `AssemblyInfo.GetImage(AssemblyNames.DB.ToString())`.
- **`override BitmapImage AssemblyImage { get; }`**
Returns a `BitmapImage` loaded from `AssemblyInfo.GetImage(AssemblyNames.DB.ToString())`. Note: `_img` is a private field reused across calls—potential thread-safety or caching concern.
- **`override string AssemblyName { get; }`**
Returns `"PowerAndBattery"` (from `AssemblyNames.PowerAndBattery.ToString()`), *not* `"DB"` as one might expect given the module name. This is likely an error or legacy artifact.
- **`override string AssemblyGroup { get; }`**
Returns `"Administrative"` (from `eAssemblyGroups.Administrative.ToString()`).
- **`override Type GetAttributeType()`**
Returns `typeof(ImageAttribute)`.
- **`override BitmapImage GetAssemblyImage()`**
Returns the value of `AssemblyImage`.
- **`override string GetAssemblyName()`**
Returns the value of `AssemblyName`.
- **`override eAssemblyRegion GetAssemblyRegion()`**
Throws `NotImplementedException`.
- **`override eAssemblyRegion AssemblyRegion { get; }`**
Throws `NotImplementedException`.
---
### 3. Invariants
- `DBImportExportModule` must be initialized *after* the Unity container is available (via DI), and before views/view models are resolved.
- The `AssemblyName` property *always* returns `"PowerAndBattery"` regardless of the actual module name (`"DBImportExportModule"`), indicating a likely bug or misconfiguration.
- `AssemblyRegion` and `GetAssemblyRegion()` are unimplemented and will throw at runtime if invoked.
- `AssemblyImage` relies on `AssemblyInfo.GetImage(AssemblyNames.DB.ToString())`, so correctness depends on `AssemblyNames.DB` being defined and `AssemblyInfo.GetImage(...)` returning a valid `BitmapImage`.
---
### 4. Dependencies
#### Dependencies *of* this module:
- **Unity (`IUnityContainer`, `IContainerRegistry`)** — for type registration.
- **Prism (`IModule`, `IContainerProvider`, `IContainerRegistry`)** — for module lifecycle integration.
- **DTS.Common (`AssemblyInfo`, `AssemblyNames`, `eAssemblyGroups`, `ImageAttribute`)** — for assembly metadata and image retrieval.
- **System.Windows.Media.Imaging (`BitmapImage`)** — for image representation.
#### Dependencies *on* this module:
- Any module or UI component that consumes `IDBImportView`, `IDBExportView`, or `IDBViewModel` (e.g., shell views, navigation services).
- The main application shell likely uses `DBImageAttribute` (via reflection over assemblies) to populate the component selection UI.
---
### 5. Gotchas
- **Critical naming mismatch**: `AssemblyName` returns `"PowerAndBattery"` instead of `"DB"` or `"DBImportExport"`. This will cause incorrect labeling in the UI.
- **Unimplemented methods**: `AssemblyRegion`, `GetAssemblyRegion()` throw `NotImplementedException`. If invoked (e.g., by UI code expecting full metadata), the app will crash.
- **Field reuse in `AssemblyImage`**: `_img` is reused across property accesses without null-check or thread-safety. If `AssemblyInfo.GetImage(...)` fails or returns null, subsequent accesses may return stale or invalid data.
- **`RegisterTypes` uses `IUnityContainer` despite receiving `IContainerRegistry`**: This suggests a mismatch between Prisms DI abstraction and Unitys concrete container, possibly indicating legacy code or improper migration.
- **`OnInitialized` is empty**: If initialization logic was intended here (e.g., post-registration wiring), it is missing.
- **No validation or error handling**: If `AssemblyNames.DB` is undefined or `AssemblyInfo.GetImage(...)` fails, the attribute constructor or property getter will throw silently during assembly load or UI rendering.
None identified beyond those above.

View File

@@ -0,0 +1,39 @@
---
source_files:
- DataPRO/Modules/SystemSettings/DBImportExport/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T04:40:44.467977+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "54976f3797d51132"
---
# Properties
## 1. Purpose
This module, named `DBImportExportModule`, is an assembly intended to support database import and export functionality within the `DataPRO` system. Based solely on the assembly metadata, it serves as a dedicated component for handling data migration, backup, or synchronization operations involving database content. Its placement under `DataPRO/Modules/SystemSettings/DBImportExport` suggests it is part of a modular architecture where system configuration capabilities—including database operations—are encapsulated separately. However, the provided source file contains only assembly-level metadata (e.g., version, GUID, visibility settings) and no implementation logic; thus, the actual import/export behavior resides in other modules or files not included here.
## 2. Public Interface
**No public types, functions, classes, or methods are defined in this file.**
The file `AssemblyInfo.cs` contains only assembly-level attributes (e.g., `AssemblyTitle`, `AssemblyVersion`) and does not declare any executable code, interfaces, or types. Therefore, there is no public API surface exposed *by this file*.
## 3. Invariants
- The assembly identity is fixed:
- `AssemblyTitle` = `"DBImportExportModule"`
- `AssemblyVersion` = `"1.0.0.0"`
- `AssemblyFileVersion` = `"1.0.0.0"`
- `Guid` = `"bc9afa01-e327-4133-8818-141281f9b3a0"`
- `ComVisible` is set to `false`, meaning types in this assembly are not exposed to COM by default.
- No runtime invariants or behavioral constraints can be inferred, as no logic is present.
## 4. Dependencies
- **Dependencies of this module**:
- `System.Reflection`, `System.Runtime.CompilerServices`, `System.Runtime.InteropServices` (standard .NET namespaces used for assembly metadata).
- **Dependents**:
- Not determinable from this file alone. The assembly is likely referenced by other modules in the `DataPRO` system (e.g., a UI or orchestration layer that triggers import/export workflows), but no direct references are visible here.
## 5. Gotchas
- **Misleading module name**: The assembly name (`DBImportExportModule`) suggests functionality, but this file contains *no implementation*—only metadata. Developers may incorrectly assume this file contains core logic.
- **Versioning**: Both `AssemblyVersion` and `AssemblyFileVersion` are hardcoded to `1.0.0.0`. This may indicate incomplete versioning strategy or that versioning is managed externally (e.g., via CI/CD).
- **COM visibility**: `ComVisible(false)` is appropriate for modern .NET code but could cause issues if legacy COM interop is required (though no evidence of such a requirement exists here).
- **No documentation comments**: The file lacks XML documentation, which is standard for `AssemblyInfo.cs` but worth noting for consistency with other modules.
- **None identified from source alone.**

View File

@@ -0,0 +1,76 @@
---
source_files:
- DataPRO/Modules/SystemSettings/DBImportExport/Resources/TranslateExtension.cs
- DataPRO/Modules/SystemSettings/DBImportExport/Resources/StringResources.Designer.cs
generated_at: "2026-04-16T04:40:36.604143+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "4daa568e9b05fe61"
---
# Resources
## Documentation: `TranslateExtension` Markup Extension
---
### 1. Purpose
This module provides a WPF `MarkupExtension` (`TranslateExtension`) to support localization of UI strings in XAML. It enables declarative binding of localized text resources (from `StringResources`) directly in XAML markup, using a string key. The extension acts as a bridge between the strongly-typed `StringResources` class and XAML, returning localized strings at runtime or a fallback marker when a key is missing or invalid.
---
### 2. Public Interface
#### `TranslateExtension` class
**Namespace:** `DBImportExport.Resources`
**Inherits:** `MarkupExtension`
- **Constructor**
```csharp
public TranslateExtension(string key)
```
Initializes a new instance with the specified resource key. The key is stored in the private readonly field `_key`.
- **`ProvideValue` method**
```csharp
public override object ProvideValue(IServiceProvider serviceProvider)
```
Returns the localized string corresponding to `_key`, or a fallback value if the key is null/empty or the string is not found.
- If `_key` is `null` or empty → returns `"#stringnotfound#"`.
- If `StringResources.ResourceManager.GetString(_key)` returns `null` → returns `"#stringnotfound# " + _key`.
- Otherwise → returns the localized string.
---
### 3. Invariants
- `_key` is immutable after construction (declared `readonly`).
- The extension **always** returns a `string` (per `[MarkupExtensionReturnType(typeof(string))]`).
- If a resource key is missing or invalid, the return value is guaranteed to begin with `"#stringnotfound#"` — no exceptions are thrown.
- The `StringResources.ResourceManager.GetString(...)` call is assumed to be thread-safe (standard for `ResourceManager`), but no explicit synchronization is present in `TranslateExtension`.
---
### 4. Dependencies
#### **Dependencies *of* this module:**
- `System.Windows.Markup` — for `MarkupExtension` base class and `MarkupExtensionReturnTypeAttribute`.
- `DBImportExport.Resources.StringResources` — specifically its `ResourceManager` property and generated strongly-typed accessors (e.g., `ExportFileBrowse_Filter`, `ImportView_Browse`, etc.).
#### **Dependencies *on* this module:**
- XAML files in the `DBImportExport` module (e.g., views for Import/Export) likely use `{local:Translate KeyName}` syntax to bind localized strings to UI elements (e.g., `TextBlock.Text`, `Button.Content`).
*(Inferred from the presence of `StringResources.Designer.cs` and usage of `TranslateExtension` in a `Resources` folder.)*
---
### 5. Gotchas
- **No null-safety for `serviceProvider`**: The `ProvideValue` method does not validate `serviceProvider` — though WPF typically provides it, misuse outside WPF may cause issues.
- **Hardcoded fallback**: The `"#stringnotfound#"` prefix is hardcoded and not configurable. This may cause visual artifacts if not handled in UI design.
- **No caching of lookups**: Each call to `ProvideValue` performs a fresh `ResourceManager.GetString(...)` lookup. While `ResourceManager` caches internally, repeated use in dynamic UIs (e.g., data templates) may incur minor overhead.
- **No culture switching support**: The extension uses the current UI culture implicitly via `StringResources.Culture`, but does not expose a way to override it per extension instance.
- **Auto-generated resource class**: `StringResources.Designer.cs` is auto-generated — manual edits will be lost. Resource keys must match exactly (case-sensitive) with entries in the `.resx` file.
- **No compile-time key validation**: Passing an incorrect key (e.g., `"ExportView_Browsse"`) will silently fall back to `"#stringnotfound# ExportView_Browsse"` at runtime.
> **None identified from source alone.** *(Note: The above are inferred based on common WPF localization patterns and the provided code structure.)*

View File

@@ -0,0 +1,55 @@
---
source_files:
- DataPRO/Modules/SystemSettings/DBImportExport/View/DBExportView.xaml.cs
- DataPRO/Modules/SystemSettings/DBImportExport/View/DBImportView.xaml.cs
generated_at: "2026-04-16T04:40:54.625854+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "0b4a108878d82619"
---
# View
## Documentation: DBImportExport View Layer
### 1. Purpose
This module provides the WPF view layer for database import and export functionality within the SystemSettings module. It exposes two XAML-backed UI components—`DBExportView` and `DBImportView`—that implement the `IDBExportView` and `IDBImportView` interfaces respectively, serving as the presentation layer for database export and import operations. These views are intended to be hosted in the main application UI and delegate behavior to corresponding view models (not included in the provided source), following a standard MVVM pattern.
### 2. Public Interface
#### `DBExportView`
- **Signature**: `public partial class DBExportView : IDBExportView`
- **Constructor**: `public DBExportView()`
- Initializes the component by calling `InitializeComponent()`, which wires up the XAML-defined UI elements.
- Implements the `IDBExportView` interface (defined in `DTS.Common.Interface`).
#### `DBImportView`
- **Signature**: `public partial class DBImportView : IDBImportView`
- **Constructor**: `public DBImportView()`
- Initializes the component by calling `InitializeComponent()`, which wires up the XAML-defined UI elements.
- Implements the `IDBImportView` interface (defined in `DTS.Common.Interface`).
> **Note**: No additional public methods, properties, or events are declared in the provided source. The actual behavior and data binding are expected to be defined in the corresponding XAML files and view models.
### 3. Invariants
- Both classes are `partial`, implying their full definition spans across `.xaml.cs` and `.xaml` files (not provided).
- `InitializeComponent()` must be called exactly once during construction; calling it again may cause runtime exceptions.
- The views assume their corresponding XAML files (`DBExportView.xaml` and `DBImportView.xaml`) exist in the same directory and define compatible UI elements.
- No validation, state mutation, or business logic is present in the provided code—behavior is delegated to view models or other layers.
### 4. Dependencies
- **External Dependency**:
- `DTS.Common.Interface` assembly (contains `IDBExportView` and `IDBImportView` interface definitions).
- **Internal Dependencies (inferred)**:
- `DBImportExport` namespace likely contains supporting types (e.g., view models, services), but none are referenced in the provided source.
- XAML files (`DBExportView.xaml`, `DBImportView.xaml`) must be present and compiled as `Page` resources.
- **Depended upon by**:
- Likely consumed by a view model or navigation service (e.g., `DBExportViewModel`, `SystemSettingsViewModel`) to instantiate and display the UI.
- May be registered via DI container or manually instantiated in a shell/window.
### 5. Gotchas
- **Misleading XML comment**: Both classes reference `PowerAndBatteryView.xaml` in their summary comments, which is inconsistent with their actual names and purpose. This may indicate copy-paste error or outdated documentation.
- **No logic in constructors**: The views are purely declarative in the provided code. Any runtime behavior (e.g., data loading, export/import triggers) must reside in the XAML or view model—developers should verify binding paths and command wiring.
- **Interface contract unknown**: Without access to `IDBExportView` and `IDBImportView`, the expected behavior (e.g., methods like `Export()`, `Import()`, or properties like `IsBusy`) cannot be determined.
- **No error handling visible**: No exception handling or validation logic is present in the provided code; failures in `InitializeComponent()` (e.g., missing XAML) will propagate unhandled.
- **None identified from source alone** for additional non-obvious behaviors beyond the above.

View File

@@ -0,0 +1,179 @@
---
source_files:
- DataPRO/Modules/SystemSettings/DBImportExport/ViewModel/DBViewModel.cs
generated_at: "2026-04-16T04:40:45.205601+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "197f884be4481037"
---
# ViewModel
## Documentation: `DBViewModel` (`DBImportExport` Module)
---
### 1. **Purpose**
The `DBViewModel` class serves as the view model for database import and export functionality within the DataPRO application. It acts as a bridge between the UI (via `IDBImportView` and `IDBExportView`) and the underlying data layer, handling user interactions for selecting import/export files, validating data, and performing file I/O operations using XML strings. Due to architectural constraints (legacy DataPRO objects reside in a separate project), its functionality is currently limited to managing XML string data flow—*not* direct database manipulation.
---
### 2. **Public Interface**
#### **Constructor**
```csharp
public DBViewModel(
IDBImportView importView,
IDBExportView exportView,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
```
- Initializes the view model with views, region/event management, and dependency injection containers.
- Sets `DataContext` of both views to `this`.
- Subscribes to `RaiseNotification` and `BusyIndicatorChangeNotification` events.
#### **Lifecycle Methods (No-op)**
All lifecycle methods currently have empty implementations:
- `void Cleanup()`
- `Task CleanupAsync()`
- `void Initialize()`
- `void Initialize(object parameter)`
- `void Initialize(object parameter, object model)`
- `Task InitializeAsync()`
- `Task InitializeAsync(object parameter)`
- `void Activated()`
#### **Event Handlers (Internal)**
- `private void OnBusyIndicatorNotification(bool eventArg)`
Sets `IsBusy` to `eventArg`.
- `private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)`
Converts `NotificationContentEventArgs` to `Notification` and raises `NotificationRequest`.
#### **Public Methods**
- `public void Export()`
Writes `ExportData` (XML string) to `ExportFileName` using `Encoding.Unicode`.
**Validation checks**:
- Fails early if `ExportFileName` or `ExportData` is null/whitespace, publishing a `ShowStatus` event with failure message.
- If `ExportFileName` already exists, deletes/moves it via `FileUtils.DeleteFileOrMove`.
- Writes file using `File.WriteAllText`.
#### **Interaction Requests (Public)**
- `public InteractionRequest<Notification> NotificationRequest { get; }`
Used to trigger notification popups (e.g., success/error messages).
- `public InteractionRequest<Confirmation> ConfirmationRequest { get; }`
Reserved for confirmation dialogs (not used in current implementation).
#### **Commands (Public)**
- `public DelegateCommand ImportBrowseCommand { get; }`
Opens an `OpenFileDialog` to select an import file. Sets `ImportFileName` and updates `ImportStatusText`.
- `public DelegateCommand ExportBrowseCommand { get; }`
Opens a `SaveFileDialog` to set `ExportFileName`.
#### **Properties (Public)**
- `IDBImportView ImportView { get; set; }`
Reference to the import view instance.
- `IDBExportView ExportView { get; set; }`
Reference to the export view instance.
- `bool IsDirty { get; private set; }`
Always `false` (never set).
- `bool IsBusy { get; set; }`
Bound to busy indicator; updated via `OnBusyIndicatorNotification`.
- `bool IsMenuIncluded { get; set; }`
Property exposed for UI binding (value never read/written beyond property setter).
- `bool IsNavigationIncluded { get; set; }`
Same as above.
- `string HeaderInfo { get; }`
Hardcoded to `"MainRegion"`.
- `string ImportData { get; set; }`
XML string for imported data (no import logic implemented—only storage).
- `string ExportData { get; set; }`
XML string for exported data (no export logic implemented—only storage).
- `string ExportFileName { get; set; }`
Full path to export file.
- `string ImportFileName { get; set; }`
Full path to import file.
- `string ImportStatusText { get; set; }`
Status message for import UI (e.g., warning about database overwrite).
- `event PropertyChangedEventHandler PropertyChanged`
Implements `INotifyPropertyChanged`.
- `void OnPropertyChanged(string propertyName)`
Raises `PropertyChanged` event.
#### **Nested Type**
- `public enum PropertyNames`
Lists property names used in `OnPropertyChanged`:
`ExportFileName`, `ImportFileName`, `ImportStatusText`.
---
### 3. **Invariants**
- `Export()` **requires**:
- `ExportFileName` must be non-null/non-whitespace.
- `ExportData` must be non-null/non-whitespace.
- `Export()` **guarantees**:
- If file exists at `ExportFileName`, it is deleted/moved before writing.
- File is written using `Encoding.Unicode`.
- `ImportBrowseMethod()`:
- Uses `OpenFileDialog` with `CheckFileExists = true` and `CheckPathExists = true`.
- Sets `ImportFileName` only if dialog succeeds.
- `ExportBrowseMethod()`:
- Uses `SaveFileDialog` with `OverwritePrompt = false`.
- Sets `ExportFileName` only if dialog succeeds.
- `IsBusy` is updated synchronously via event subscription (on publisher thread).
- `ImportStatusText` is updated *only* in `ImportBrowseMethod()` (no import operation is triggered by this view model).
---
### 4. **Dependencies**
#### **Imports/Usings**
- `System.ComponentModel`, `System.ComponentModel.Composition`, `System.Threading.Tasks`
- `DTS.Common.Events` (e.g., `RaiseNotification`, `BusyIndicatorChangeNotification`, `ShowStatus`, `StatusInfo`)
- `Prism.Events`, `Prism.Regions`, `Prism.Commands`
- `Unity` (for `IUnityContainer`)
- `DTS.Common.Interface` (e.g., `IDBImportView`, `IDBExportView`, `IDBViewModel`)
- `DTS.Common.Utils` (e.g., `FileUtils`)
- `DTS.Common.Interactivity` (e.g., `InteractionRequest<T>`)
- `System.Text` (for `Encoding`)
- `System.Windows.Forms` (for `OpenFileDialog`, `SaveFileDialog`)
#### **Consumed Types**
- `IDBImportView`, `IDBExportView`, `IDBViewModel` (from `DBImportExport` namespace)
- `NotificationContentEventArgs`, `StatusInfo`, `StatusInfo.StatusState`
- `FileUtils.DeleteFileOrMove`
- `Resources.StringResources` (for UI strings: `ImportFileBrowse_Filter`, `ExportFileBrowse_Filter`, `ExportFileName_Empty`, `ExportFileData_Empty`)
#### **Depended Upon By**
- Prism-based shell/shell regions (via `IRegionManager`).
- Event publishers (e.g., `RaiseNotification`, `BusyIndicatorChangeNotification`).
- Views (`IDBImportView`, `IDBExportView`) bound to this view model.
---
### 5. **Gotchas**
- **No actual import/export logic**:
`ImportData` and `ExportData` are *only* storage properties. No code parses, validates, or processes the XML strings. Import/export is purely file I/O—*no database interaction* occurs in this class.
- **`Cleanup()`/`Initialize()` are no-ops**:
Lifecycle methods exist for interface compliance but perform no work.
- **`IsDirty` is never set**:
Always `false`; likely unused or incomplete.
- **`IsMenuIncluded`/`IsNavigationIncluded` unused**:
Properties exist but have no observed consumers in this file.
- **Hardcoded `HeaderInfo`**:
Always `"MainRegion"`—no dynamic behavior.
- **`LogDummyFunc` does nothing**:
Passed to `FileUtils.DeleteFileOrMove` but never logs (silently ignores errors).
- **No import operation triggered**:
`ImportFileName` is set via browse dialog, but no `Import()` method exists to process the file.
- **`Export()` writes directly without user confirmation**:
Overwrites existing files silently (only uses `FileUtils.DeleteFileOrMove`).
- **`NotificationRequest` conversion quirk**:
`OnRaiseNotification` constructs a new `NotificationContentEventArgs` with empty strings for `Image` and `CommandParameter`—may lose data if callers rely on them.
- **Thread safety**:
`IsBusy` updates occur on `PublisherThread` (via `ThreadOption.PublisherThread`), but other properties lack thread-safety guarantees.
> **None identified from source alone** for critical bugs or anti-patterns beyond the above architectural limitations.

View File

@@ -0,0 +1,83 @@
---
source_files:
- DataPRO/Modules/SystemSettings/ISOSettings/ISOSettingsModule.cs
generated_at: "2026-04-16T04:39:52.161658+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "d9b10982c2687d59"
---
# ISOSettings
## Documentation: ISOSettingsModule
### 1. Purpose
The `ISOSettingsModule` is a Prism module responsible for bootstrapping and registering the ISO Settings feature within the applications modular UI architecture. It integrates with the Unity dependency injection container to register the view (`ISOSettingsView`) and view model (`ISOSettingsViewModel`) as singleton services, enabling their later resolution and use in the UI. Additionally, it exposes metadata about the module (e.g., display name, group, and icon) via the `ISOSettingsImageAttribute` assembly-level attribute, allowing the main shell to render the module on the main screen under the *Administrative* group.
### 2. Public Interface
#### `ISOSettingsModule` class
- **`ISOSettingsModule(IUnityContainer unityContainer)`**
Constructor. Accepts a Unity container via dependency injection and stores it for later use in type registration.
- **`void Initialize()`**
Registers two interfaces to their concrete implementations as singleton types in the Unity container:
- `IISOSettingsView``ISOSettingsView`
- `IISOSettingsViewModel``ISOSettingsViewModel`
This method is called both directly during module initialization and indirectly via `RegisterTypes`.
- **`void OnInitialized(IContainerProvider containerProvider)`**
Currently empty. No initialization logic is performed after module registration.
- **`void RegisterTypes(IContainerRegistry containerRegistry)`**
Delegates to `Initialize()` to perform type registration. Note: Although the method signature uses `IContainerRegistry` (Prisms abstraction), the implementation uses the injected `IUnityContainer` directly—this may indicate a mismatch or legacy pattern.
#### `ISOSettingsImageAttribute` class
- **`ISOSettingsImageAttribute()`**
Default constructor; delegates to the parameterized constructor with `null`.
- **`ISOSettingsImageAttribute(string s)`**
Constructor accepting a string argument (unused); initializes `_img` by calling `AssemblyInfo.GetImage(AssemblyNames.IsoSettings.ToString())`.
- **`override BitmapImage AssemblyImage { get; }`**
Returns the assemblys icon image, retrieved via `AssemblyInfo.GetImage(AssemblyNames.IsoSettings.ToString())`.
- **`override string AssemblyName { get; }`**
Returns `"IsoSettings"` (via `AssemblyNames.IsoSettings.ToString()`).
- **`override string AssemblyGroup { get; }`**
Returns `"Administrative"` (via `eAssemblyGroups.Administrative.ToString()`).
- **`override eAssemblyRegion AssemblyRegion { get; }`**
Throws `NotImplementedException`.
- **`override eAssemblyRegion GetAssemblyRegion()`**
Throws `NotImplementedException`.
- **`override Type GetAttributeType()`**
Returns `typeof(ImageAttribute)`.
- **`override BitmapImage GetAssemblyImage()`**
Returns `AssemblyImage`.
- **`override string GetAssemblyName()`**
Returns `AssemblyName`.
- **`override string GetAssemblyGroup()`**
Returns `AssemblyGroup`.
> **Note**: Several members (`AssemblyRegion`, `GetAssemblyRegion()`) are unimplemented and throw exceptions at runtime if invoked.
### 3. Invariants
- The `ISOSettingsModule` must be loaded *before* any consumer attempts to resolve `IISOSettingsView` or `IISOSettingsViewModel`, as registration occurs only during `Initialize()`/`RegisterTypes()`.
- `AssemblyInfo.GetImage()` and `AssemblyNames.IsoSettings` must be valid and return non-null values at runtime; otherwise, `AssemblyImage` will fail.
- The `AssemblyGroup` is hardcoded to `"Administrative"` and cannot be changed without recompilation.
- The `ISOSettingsImageAttribute` is intended for use as an assembly-level attribute (via `[assembly: ISOSettingsImageAttribute]`), but its implementation is incomplete—`AssemblyRegion` and related methods are non-functional.
### 4. Dependencies
- **Imports/Dependencies**:
- `DTS.Common` and `DTS.Common.Interface` (for `AssemblyInfo`, `AssemblyNames`, `eAssemblyGroups`, `ImageAttribute`, `eAssemblyRegion`)
- `Prism.Modularity` (for `IModule`)
- `Prism.Ioc` (for `IContainerRegistry`)
- `Unity` (for `IUnityContainer`)
- `System.ComponentModel.Composition` (for `[Export]`)
- `System.Windows.Media.Imaging` (for `BitmapImage`)
- **Depended upon by**:
- The Prism module catalog/loader (via `[Export(typeof(IModule))]` and `[Module(ModuleName = "ISOSettings")]`)
- The main shell/application UI (via the `ISOSettingsImageAttribute` assembly attribute, used to display module metadata on the main screen)
### 5. Gotchas
- **`RegisterTypes` uses `IContainerRegistry` but internally relies on `IUnityContainer`**: The method signature suggests Prisms DI abstraction, but the implementation uses the injected Unity container directly. This may cause confusion or breakage if the module is used with a non-Unity container.
- **`AssemblyRegion` and `GetAssemblyRegion()` are unimplemented**: Any attempt to access these will throw `NotImplementedException`. This may be intentional (unused code path) or technical debt.
- **Redundant `Initialize()` call in `RegisterTypes`**: Since `Initialize()` is called directly in `RegisterTypes`, and `Initialize()` is also called during Prisms `Initialize()` lifecycle, there is potential for double-registration if `RegisterTypes` is invoked multiple times (though Unity registrations are idempotent for singleton mappings).
- **Unused constructor parameter in `ISOSettingsImageAttribute(string s)`**: The `s` parameter is ignored.
- **No validation on image retrieval**: If `AssemblyInfo.GetImage()` returns `null` (e.g., missing image resource), `AssemblyImage` will silently return `null`, potentially causing UI rendering issues.
- **Hardcoded string values**: `"IsoSettings"` and `"Administrative"` are derived from enumToString() calls; while safer than literals, they assume the underlying enums (`AssemblyNames`, `eAssemblyGroups`) are correctly defined and stable.

View File

@@ -0,0 +1,67 @@
---
source_files:
- DataPRO/Modules/SystemSettings/ISOSettings/Classes/ISOSettingsData.cs
generated_at: "2026-04-16T04:41:58.215647+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "673c2c087dd23a72"
---
# Classes
### **Purpose**
This module defines the data model for system-level ISO-related configuration settings, specifically governing how ISO codes, user codes, and channel names are displayed and validated within the test setup UI. It enables runtime control over view modes (e.g., ISO-only, user-code-only, combined), enforces uniqueness constraints on ISO codes, and optionally validates test object and position fields during test setup validation—behavior that is configurable per site via system settings.
---
### **Public Interface**
#### **Properties**
All properties implement `INotifyPropertyChanged` via inheritance from `BasePropertyChanged`, raising `PropertyChanged` events on change.
| Property | Type | Description |
|---------|------|-------------|
| `ValidateTestObjectAndPosition` | `bool` | Controls whether validation of `TestObject` and `position` ISO fields is performed during test setup validation. Enabled via site-specific system settings (see comment referencing issue #15457). |
| `UniqueISOCodesRequired` | `bool` | If `true`, enforces that all ISO codes in the system must be unique. |
| `UniqueISOCodesRequiredAndShowISOCodes` | `bool` | Computed property: `true` iff both `UniqueISOCodesRequired` and `ShowISOCodes` are `true`. |
| `ShowISOCodes` | `bool` | Controls visibility of ISO codes in the UI. Setting to `true` adjusts `ISOViewMode` to include ISO codes (e.g., `ISOAndUserCode` or `ISOOnly`); setting to `false` removes ISO codes (e.g., `UserCodeOnly` or `ChannelNameOnly`). **Raises `PropertyChanged` for multiple dependent properties** (`ShowISOStringBuilder`, `UniqueISOCodesRequired`, `UseISOCodeFilterMapping`, `UniqueISOCodesRequiredAndShowISOCodes`). |
| `ShowUserCodes` | `bool` | Controls visibility of user codes in the UI. Setting to `true` adjusts `ISOViewMode` to include user codes (e.g., `ISOAndUserCode` or `UserCodeOnly`); setting to `false` removes user codes. |
| `ShowISOStringBuilder` | `bool` | Toggles visibility of the ISO string builder UI component. |
| `ShowChannelCodeLookupHelper` | `bool` | Toggles visibility of the channel code lookup helper UI component. |
| `UseISOCodeFilterMapping` | `bool` | Controls whether ISO code filter mapping logic is applied. |
| `ChannelNamesOnly` | `bool` | If `true`, forces `ISOViewMode` to `IsoViewMode.ChannelNameOnly`. Setting to `false` has no effect (must be toggled via `ShowISOCodes`/`ShowUserCodes`). |
| `ISOViewMode` | `IsoViewMode` | Enumerated view mode controlling which identifiers (ISO, user code, channel name) are displayed. Valid values inferred from usage: `ChannelNameOnly`, `UserCodeOnly`, `ISOOnly`, `ISOAndUserCode`. Changing this property raises `PropertyChanged` for `ShowISOCodes`, `ShowUserCodes`, and `ChannelNamesOnly`. |
---
### **Invariants**
- `ISOViewMode` is the canonical source of truth for UI display mode; all boolean view flags (`ShowISOCodes`, `ShowUserCodes`, `ChannelNamesOnly`) are derived from it.
- `ShowISOCodes` and `ShowUserCodes` are **not independent**:
- `ShowISOCodes == true``ISOViewMode ∈ {IsoViewMode.ISOOnly, IsoViewMode.ISOAndUserCode}`
- `ShowUserCodes == true``ISOViewMode ∈ {IsoViewMode.UserCodeOnly, IsoViewMode.ISOAndUserCode}`
- `UniqueISOCodesRequiredAndShowISOCodes` is logically consistent: `true` only when both operands are `true`.
- Setting `ShowISOCodes` or `ShowUserCodes` may mutate `ISOViewMode` to maintain consistency; the reverse is not true—setting `ISOViewMode` does *not* mutate `ShowISOCodes`/`ShowUserCodes` (they remain independent setters).
- `ChannelNamesOnly = true` unconditionally sets `ISOViewMode = ChannelNameOnly`; `ChannelNamesOnly = false` has no side effect.
---
### **Dependencies**
- **Imports/Usings**:
- `DTS.Common.Enums` → Provides `IsoViewMode` enum.
- `DTS.Common.Interface` → Provides `IISOSettingsData` interface (implementation contract).
- `DTS.Common.Base.BasePropertyChanged` → Base class enabling property change notifications.
- **Implied Consumers**:
- UI components that bind to `ISOSettingsData` (e.g., settings panels, test setup forms).
- Validation logic that checks `ValidateTestObjectAndPosition` during test setup validation.
- Code that enforces `UniqueISOCodesRequired` (e.g., ISO code generation or persistence layers).
- **No internal dependencies** on other modules beyond `DTS.Common.*`.
---
### **Gotchas**
- **Asymmetric mutability**: Setting `ChannelNamesOnly = false` has *no effect*; the only way to exit `ChannelNameOnly` mode is via `ShowISOCodes` or `ShowUserCodes`. This may confuse developers expecting bidirectional control.
- **Side effects in setters**: `ShowISOCodes` and `ShowUserCodes` setters mutate `ISOViewMode` and raise `PropertyChanged` for *multiple* dependent properties. This could cause cascading UI updates or unexpected re-evaluation of computed properties (e.g., `UniqueISOCodesRequiredAndShowISOCodes`).
- **`UniqueISOCodesRequired` dependency**: The property `UniqueISOCodesRequiredAndShowISOCodes` is recomputed on `ShowISOCodes` changes, but `UniqueISOCodesRequired` itself has no validation logic in this class—enforcement must occur elsewhere.
- **Enum assumptions**: `IsoViewMode` is assumed to have at least four values (`ChannelNameOnly`, `UserCodeOnly`, `ISOOnly`, `ISOAndUserCode`), but the enum definition is not included in the source.
- **No validation in setters**: Properties like `UniqueISOCodesRequired` accept arbitrary `bool` values without runtime checks; invalid combinations (e.g., `UniqueISOCodesRequired = true` but `ShowISOCodes = false`) are allowed and must be handled by consumers.
- **Commented issue reference**: The `ValidateTestObjectAndPosition` propertys comment references “site bool in system settings” and issue #15457—suggesting external configuration, but no source-level linkage is visible here.

View File

@@ -0,0 +1,126 @@
---
source_files:
- DataPRO/Modules/SystemSettings/ISOSettings/Model/Enums.cs
- DataPRO/Modules/SystemSettings/ISOSettings/Model/ISOSettingsModel.cs
generated_at: "2026-04-16T04:42:28.425769+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "080376d61a35b88d"
---
# Model
## Documentation: ISOSettings Module
---
### 1. **Purpose**
This module manages system-wide configuration settings related to ISO code handling within the DataPRO test management system. It provides a centralized model (`ISOSettingsModel`) for reading, writing, and persisting user-configurable preferences that control how ISO codes, user codes, and related UI elements are displayed and enforced during test setup and execution. It also enforces business rules—such as requiring unique ISO codes or validating test object/position fields—and triggers re-evaluation of test completeness (`IsComplete`) when certain settings change, ensuring data integrity across test setups.
---
### 2. **Public Interface**
#### `class ISOSettingsModel : IISOSettingsModel`
> **Constructor**
> `public ISOSettingsModel(IEventAggregator eventAggregator)`
> Initializes the model with an `IEventAggregator` instance for publishing notifications (e.g., on save failure).
> *Note:* `IISOSettingsModel` interface is referenced but not defined in the provided source; assumed to be declared elsewhere.
> **`LoadData()`**
> `public IISOSettingsData LoadData()`
> Returns a new `ISOSettingsData` instance populated with the *current* values of the following properties:
> - `ISOViewMode`
> - `ShowISOStringBuilder`
> - `ShowChannelCodeLookupHelper`
> - `UseISOCodeFilterMapping`
> - `UniqueISOCodesRequired`
> - `ValidateTestObjectAndPosition`
> *Note:* Does *not* include `ShowISOCodes`, `ShowUserCodes`, or `ISOSupportLevel` in the returned data.
> **`SaveData(IISOSettingsData data)`**
> `public void SaveData(IISOSettingsData data)`
> Updates the models internal state from the provided `data` object (assumed to be of concrete type `ISOSettingsData`).
> - Updates `ShowISOCodes`, `ShowUserCodes`, `ISOViewMode`, `ShowISOStringBuilder`, `ShowChannelCodeLookupHelper`, `UseISOCodeFilterMapping`, `UniqueISOCodesRequired`, and `ValidateTestObjectAndPosition`.
> - If `UniqueISOCodesRequired` or `ValidateTestObjectAndPosition` changes value, calls `MarkAllTestsDirty()` to re-evaluate test completeness.
> - On exception, publishes a notification via `EventAggregator` with message and stack trace.
> - Sets `IsSaved = true` on success.
> **`OnPropertyChanged(string propertyName)`**
> `public void OnPropertyChanged(string propertyName)`
> Currently a no-op stub. Intended for `INotifyPropertyChanged` compliance but not implemented.
> **`IsSaved`**
> `public bool IsSaved { get; private set; }`
> Gets a flag indicating whether the last `SaveData` call succeeded.
> **`PropertyChanged`**
> `public event PropertyChangedEventHandler PropertyChanged;`
> Declared but unused (no raises observed in source).
#### **Public Properties (Read/Write via SettingsDB)**
All properties are backed by `SettingsDB.GetGlobalValue*` / `SetGlobalValue*` methods.
| Property | Type | Default | Description |
|---------|------|---------|-------------|
| `ISOSupportLevel` | `IsoSupportLevels` | `IsoSupportLevels.ISO_ONLY` | Controls overall ISO support behavior (e.g., ISO-only, transitional, non-ISO allowed). |
| `ShowISOCodes` | `bool` | `true` | Controls visibility of ISO codes in UI. |
| `ShowUserCodes` | `bool` | `false` | Controls visibility of user-defined codes in UI. |
| `ValidChannelCodes` | `bool` | — | Derived: `true` if *either* `ShowISOCodes` or `ShowUserCodes` is `true`. |
| `ISOViewMode` | `IsoViewMode` | — | Computed view mode based on `ShowISOCodes`/`ShowUserCodes`. Setter updates both flags accordingly. |
| `ShowISOStringBuilder` | `bool` | `true` | Controls visibility of the ISO string builder UI component. |
| `ShowChannelCodeLookupHelper` | `bool` | `true` | Controls visibility of the channel code lookup helper UI component. |
| `UseISOCodeFilterMapping` | `bool` | `true` | Enables/disables ISO code filter mapping logic. |
| `UniqueISOCodesRequired` | `bool` | `true` | Enforces uniqueness of ISO codes across test setups. |
| `AllowTransitional` | `bool` | `false` | Permits transitional (non-standard) ISO codes. |
| `AllowNonISO` | `bool` | `false` | Permits non-ISO codes. |
| `UseUserCodes` | `bool` | `false` | Enables use of user-defined codes (distinct from `ShowUserCodes`). |
| `ValidateTestObjectAndPosition` | `bool` | `false` | Enables validation of ISO test object/position fields against test setup rules. |
---
### 3. **Invariants**
- **Persistence**: All settings are persisted globally via `SettingsDB` using string keys derived from `Keys` enum values.
- **View Mode Consistency**: `ISOViewMode` is *derived* from `ShowISOCodes` and `ShowUserCodes`. Setting `ISOViewMode` *always* updates both underlying flags to match the requested view.
- **Dirty Test Re-evaluation**: Changing `UniqueISOCodesRequired` or `ValidateTestObjectAndPosition` triggers `MarkAllTestsDirty()`, which marks *all* test setups as incomplete/dirty to force re-validation of `IsComplete`.
- **Validation Scope**: `ValidateTestObjectAndPosition` only affects test setup validation logic (not runtime behavior), and its effect is conditional on being enabled at validation time.
- **Code Visibility**: `ValidChannelCodes` is a computed property and *must* equal `ShowISOCodes || ShowUserCodes` at all times.
---
### 4. **Dependencies**
#### **Internal Dependencies**
- **`DTS.Common.Settings.SettingsDB`**: Used for global setting persistence (`GetGlobalValue`, `SetGlobalValue`, `GetGlobalValueBool`, `SetGlobalValueBoolean`).
- **`DTS.Common.Events.IEventAggregator`**: Used to publish `RaiseNotification` events on save failure.
- **`DTS.Common.Enums.IsoSupportLevels`**, **`IsoViewMode`**: Enum types used for `ISOSupportLevel` and `ISOViewMode`.
- **`ISOSettingsData`**: Concrete implementation of `IISOSettingsData`, used in `LoadData()` and `SaveData()`.
- **`DbOperations.TestSetupsGet(...)` / `TestSetupsMarkIsCompleteIsDirty(...)`**: Used by `GetAllTests()` and `MarkTestDirty()` to enumerate and mark tests as dirty.
#### **External Dependencies**
- **Prism.Events**: For `IEventAggregator`.
- **System.ComponentModel**: For `INotifyPropertyChanged` interface (partially implemented).
- **System.Linq**: For `records.Any()`, `tests.Any()`.
#### **Depended Upon**
- `IISOSettingsModel` interface (not shown) is likely consumed by UI/view-layer components (e.g., settings view models or pages).
---
### 5. **Gotchas**
- **`LoadData()` omits key properties**: The returned `IISOSettingsData` does *not* include `ShowISOCodes`, `ShowUserCodes`, or `ISOSupportLevel`, despite these being core settings. This may cause data loss if `SaveData()` is called with such an incomplete object (though `SaveData()` explicitly casts to `ISOSettingsData`, implying the consumer is expected to populate all fields).
- **`ISOViewMode` setter is side-effectful**: Changing `ISOViewMode` *overwrites* `ShowISOCodes` and `ShowUserCodes` without preserving their prior values. This is non-intuitive if the caller expects `ISOViewMode` to be a derived-only property.
- **`MarkAllTestsDirty()` is expensive**: Iterates over *all* test setups in the database and marks each as dirty. This is triggered on *any* change to `UniqueISOCodesRequired` or `ValidateTestObjectAndPosition`, regardless of whether tests are currently complete or relevant.
- **No change notification**: `OnPropertyChanged` is a stub; UI bindings relying on `INotifyPropertyChanged` will not update automatically when settings change.
- **Hardcoded defaults**: Default values are defined as `const` fields (e.g., `ShowISOCodesDefault = true`) but are *not* used in `LoadData()`—only in property getters/setters. If `ISOSettingsData` is constructed externally, defaults may not be applied consistently.
- **Commented tech debt**: The `SaveData()` method includes comments referencing internal issue IDs (`#14215`, `#16235`, `#15457`) and notes about future optimization for selective test dirtying. This indicates known performance debt.
- **No validation in `SaveData()`**: The method casts `data` to `ISOSettingsData` without checking type safety (will throw `InvalidCastException` if misused). No validation of input values is performed.
---
*Documentation generated from provided source files. No external behavior or APIs inferred beyond what is explicitly present.*

View File

@@ -0,0 +1,103 @@
---
source_files:
- DataPRO/Modules/SystemSettings/ISOSettings/Properties/AssemblyInfo.cs
- DataPRO/Modules/SystemSettings/ISOSettings/Properties/Annotations.cs
generated_at: "2026-04-16T04:42:26.994226+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "21be5491446b89ad"
---
# Properties
## Documentation: `ISOSettings` Assembly (DataPRO Module)
---
### 1. **Purpose**
This module is the `ISOSettings` assembly, a .NET class library within the `DataPRO` system responsible for managing ISO-related system settings. Based on its name and placement under `DataPRO/Modules/SystemSettings/ISOSettings`, it likely encapsulates configuration logic, data models, and possibly UI-related components for handling ISO (International Organization for Standardization) standards—such as country codes, language codes, or other standardized identifiers used in system configuration. However, **no implementation files (e.g., `.cs` source files beyond `AssemblyInfo.cs` and `Annotations.cs`) are provided**, so the actual business logic, types, or public APIs beyond the annotation attributes are *not visible* in the given source. The assembly serves as a foundational module for system settings related to ISO standards, but its concrete functionality cannot be determined from the provided files.
---
### 2. **Public Interface**
The only *publicly visible* types in the provided source are the **JetBrains.Annotations**-style attributes defined in `ISOSettings.Annotations`. These are *not* functional logic but metadata annotations used for static analysis (e.g., by ReSharper or Rider). They are part of a local copy of JetBrains annotation library, re-packaged under the `ISOSettings.Annotations` namespace.
Below are the **public attributes** defined in `Annotations.cs`:
| Name | Signature | Purpose |
|------|-----------|---------|
| `CanBeNullAttribute` | `public sealed class CanBeNullAttribute : Attribute` | Indicates the annotated element *may* be `null`. |
| `NotNullAttribute` | `public sealed class NotNullAttribute : Attribute` | Indicates the annotated element *must never* be `null`. |
| `ItemNotNullAttribute` | `public sealed class ItemNotNullAttribute : Attribute` | For collections/Tasks/Lazy, indicates *items/results* are never `null`. |
| `ItemCanBeNullAttribute` | `public sealed class ItemCanBeNullAttribute : Attribute` | For collections/Tasks/Lazy, indicates *items/results* may be `null`. |
| `ImplicitNotNullAttribute` | `public sealed class ImplicitNotNullAttribute : Attribute` | Applies `[NotNull]`/`[ItemNotNull]` implicitly to all members in scope. |
| `StringFormatMethodAttribute` | `public sealed class StringFormatMethodAttribute : Attribute` | Marks methods that build strings from format patterns (e.g., `string.Format`). Constructor takes `formatParameterName`. |
| `ValueProviderAttribute` | `public sealed class ValueProviderAttribute : Attribute` | Indicates a parameter/property/field should be one of a limited set of values (e.g., enum-like). Constructor takes `name` (likely referencing a provider type). |
| `InvokerParameterNameAttribute` | `public sealed class InvokerParameterNameAttribute : Attribute` | For parameters expected to match a callers parameter name (e.g., `ArgumentNullException`s `paramName`). |
| `NotifyPropertyChangedInvocatorAttribute` | `public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute` | Marks methods used to notify property changes (e.g., `INotifyPropertyChanged`). Optional constructor for `parameterName`. |
| `ContractAnnotationAttribute` | `public sealed class ContractAnnotationAttribute : Attribute` | Describes input/output behavior contracts (e.g., `null => null; notnull => notnull`). Constructor takes `contract` string. |
| `LocalizationRequiredAttribute` | `public sealed class LocalizationRequiredAttribute : Attribute` | Indicates an element requires localization. Constructor optional `required` (default `true`). |
| `CannotApplyEqualityOperatorAttribute` | `public sealed class CannotApplyEqualityOperatorAttribute : Attribute` | Indicates `==`/`!=` should not be used (use `Equals()` instead). |
| `BaseTypeRequiredAttribute` | `public sealed class BaseTypeRequiredAttribute : Attribute` | Requires types using this attribute to implement a specific base type. Constructor takes `baseType`. |
| `UsedImplicitlyAttribute` | `public sealed class UsedImplicitlyAttribute : Attribute` | Marks elements used implicitly (e.g., via reflection) to suppress unused warnings. Has overloads with `ImplicitUseKindFlags`/`ImplicitUseTargetFlags`. |
| `MeansImplicitUseAttribute` | `public sealed class MeansImplicitUseAttribute : Attribute` | Applied to attributes to mark types using them as implicitly used. Has same flags overloads. |
| `PublicAPIAttribute` | `public sealed class PublicAPIAttribute : Attribute` | Marks publicly exposed API that should not be removed. Optional `comment`. |
| `InstantHandleAttribute` | `public sealed class InstantHandleAttribute : Attribute` | Indicates a delegate/`IEnumerable` parameter is consumed synchronously (e.g., executed/enumerated before method returns). |
| `PureAttribute` | `public sealed class PureAttribute : Attribute` | Indicates method has no side effects (like `System.Diagnostics.Contracts.PureAttribute`). |
| `MustUseReturnValueAttribute` | `public sealed class MustUseReturnValueAttribute : Attribute` | Indicates return value must be used. Optional `justification`. |
| `ProvidesContextAttribute` | `public sealed class ProvidesContextAttribute : Attribute` | Indicates a member provides a context value that should be used instead of alternatives. |
| `PathReferenceAttribute` | `public sealed class PathReferenceAttribute : Attribute` | Indicates a parameter is a file/folder path in a web project. Optional `basePath`. |
| `SourceTemplateAttribute` | `public sealed class SourceTemplateAttribute : Attribute` | Marks extension methods as source templates (e.g., for ReSharper live templates). |
| `MacroAttribute` | `public sealed class MacroAttribute : Attribute` | Specifies macros for `SourceTemplate` parameters (`Expression`, `Editable`, `Target`). |
| `AspMvc*` attributes (e.g., `AspMvcActionAttribute`, `AspMvcAreaAttribute`, etc.) | Multiple `public sealed class` attributes | ASP.NET MVC-specific annotations for view/controller/action resolution. |
| `Razor*` attributes (e.g., `RazorSectionAttribute`, `RazorImportNamespaceAttribute`) | Multiple `public sealed class` attributes | Razor view engine annotations (sections, imports, directives). |
| `Xaml*` attributes (e.g., `XamlItemsControlAttribute`) | `public sealed class` attributes | XAML-specific annotations for data context resolution. |
| `HtmlElementAttributesAttribute`, `HtmlAttributeValueAttribute` | `public sealed class` attributes | HTML attribute annotations for static analysis. |
| `CollectionAccessAttribute` | `public sealed class CollectionAccessAttribute : Attribute` | Indicates how a method affects collection contents. Constructor takes `CollectionAccessType`. |
| `CollectionAccessType` enum | `public enum CollectionAccessType` | Values: `None`, `Read`, `ModifyExistingContent`, `UpdatedContent`. |
| `AssertionMethodAttribute`, `AssertionConditionAttribute` | `public sealed class` attributes | Marks assertion methods (e.g., `Guard.NotNull(...)`) and their condition parameters. |
| `AssertionConditionType` enum | `public enum AssertionConditionType` | Values: `IS_TRUE`, `IS_FALSE`, `IS_NULL`, `IS_NOT_NULL`. |
| `TerminatesProgramAttribute` | `[Obsolete] public sealed class TerminatesProgramAttribute : Attribute` | Obsolete; use `[ContractAnnotation("=> halt")]` instead. |
| `LinqTunnelAttribute`, `NoEnumerationAttribute`, `RegexPatternAttribute` | `public sealed class` attributes | LINQ, enumeration, and regex pattern annotations. |
| `NoReorder` | `public sealed class NoReorder : Attribute` | Prevents member reordering in IDEs. |
> **Note**: None of these attributes contain executable logic. They are *purely metadata* for tooling.
---
### 3. **Invariants**
- **No runtime behavior**: The attributes defined here are *compile-time-only* annotations. They have no effect at runtime unless consumed by a static analyzer (e.g., ReSharper).
- **Attribute usage constraints**: Each attributes `[AttributeUsage(...)]` enforces where it can be applied (e.g., `NotNullAttribute` may be applied to methods, parameters, properties, etc., but not to assemblies).
- **No validation of attribute usage**: The attributes themselves do not enforce correctness; misuse (e.g., applying `[NotNull]` to a value that *is* null) will not cause runtime exceptions.
- **No public API surface beyond attributes**: Since no other source files are provided, there are no classes, methods, or interfaces whose invariants can be documented.
---
### 4. **Dependencies**
#### Dependencies *of* this assembly:
- **.NET Framework** (implied by `System.*` namespaces and `AssemblyInfo.cs` style).
- **JetBrains.Annotations** (via the `Annotations.cs` file, which is a verbatim copy of JetBrains annotation library, repackaged here).
- This is *not* a runtime dependency; its a *source dependency* for static analysis tooling.
- The `Annotations.cs` file includes the MIT license from JetBrains.
#### Dependencies *on* this assembly:
- **Unknown** — no other modules or projects are referenced in the provided source.
- Since this is an assembly (`AssemblyInfo.cs`), it is likely referenced by other modules in the `DataPRO` system (e.g., `SystemSettings` or UI modules), but this is inferred from folder structure, not source.
---
### 5. **Gotchas**
- **Misleading namespace**: The `ISOSettings.Annotations` namespace suggests this module *contains* ISO-related logic, but the provided files only contain *annotations*—not actual ISO settings implementation. This may confuse developers expecting business logic.
- **No versioning in annotations**: The `Annotations.cs` file is a static copy of JetBrains annotations (copyright 2016). It may be outdated relative to newer JetBrains annotation versions (e.g., missing newer attributes like `[NotNullForRef]`, `[SuppressMessage]`, etc.).
- **No documentation comments for attributes**: While XML doc comments exist, they are minimal and copied from JetBrains original. Developers should verify behavior in context of their static analyzer.
- **`[ComVisible(false)]`**: The assembly is not visible to COM (`ComVisible(false)`), which may matter if interoperating with legacy COM components.
- **Hardcoded GUID**: The `Guid("7446722e-490d-4f6a-beaf-907947e576d5")` is fixed. Changing it may break COM interop or strong-naming if used elsewhere.
- **Assembly version `1.0.0.0`**: Both `AssemblyVersion` and `AssemblyFileVersion` are `1.0.0.0`. This may indicate incomplete versioning or a placeholder.
> **None identified from source alone.**
> *(Note: The above gotchas are inferred from *structure and content* of the provided files, not runtime behavior.)*

View File

@@ -0,0 +1,132 @@
---
source_files:
- DataPRO/Modules/SystemSettings/ISOSettings/Resources/TranslateExtension.cs
- DataPRO/Modules/SystemSettings/ISOSettings/Resources/StringResources.Designer.cs
generated_at: "2026-04-16T04:42:04.078678+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "fa1be3ee1b42a3c2"
---
# Resources
## Documentation: `TranslateExtension` and `StringResources`
---
### 1. **Purpose**
This module provides localized string resolution for WPF UI elements within the `ISOSettings` module. It enables declarative binding of localized text in XAML via the `TranslateExtension` markup extension, which retrieves strings from the strongly-typed `StringResources` resource class. The module acts as a bridge between WPFs XAML rendering pipeline and the applications embedded resource strings, supporting internationalization (i18n) by allowing UI text to be translated without hardcoding values.
---
### 2. **Public Interface**
#### `TranslateExtension` class
- **Namespace**: `ISOSettings.Resources`
- **Inherits**: `MarkupExtension` (from `System.Windows.Markup`)
- **Purpose**: A WPF markup extension used in XAML to fetch localized strings at runtime.
##### Constructor
- `public TranslateExtension(string key)`
- Initializes the extension with a resource key (`_key`).
- Throws no exceptions; invalid keys are handled gracefully at `ProvideValue` time.
##### Method
- `public override object ProvideValue(IServiceProvider serviceProvider)`
- **Behavior**:
- Returns `"#stringnotfound#"` if `_key` is `null` or empty.
- Otherwise, retrieves the localized string via `StringResources.ResourceManager.GetString(_key)`.
- If the string is not found (`null`), returns `"#stringnotfound# <key>"`.
- **Parameters**:
- `serviceProvider`: Used by WPF to resolve services (e.g., `IProvideValueTarget`), but not used in the implementation.
- **Return type**: `object` (castable to `string`).
#### `StringResources` class
- **Namespace**: `ISOSettings.Resources`
- **Purpose**: Auto-generated strongly-typed resource class for accessing embedded localized strings.
- **Note**: This class is **not public** (`internal`), and its members are only used internally by `TranslateExtension`.
- **Key members**:
- `internal static ResourceManager ResourceManager { get; }`
- Lazily initializes and returns a `System.Resources.ResourceManager` for the `"ISOSettings.Resources.StringResources"` base name.
- `internal static CultureInfo Culture { get; set; }`
- Allows overriding the UI culture for resource lookups (e.g., for testing or dynamic language switching).
- **Static properties** (examples):
- `internal static string AllowNonISO { get; }`
- `internal static string ChannelNamesOnly { get; }`
- `internal static string ISOOnly { get; }`
- `internal static string ISOSupportLevel { get; }`
- `internal static string NoISO { get; }`
- `internal static string RequireUniqueISOCodes { get; }`
- `internal static string ShowChannelCodeLookupHelper { get; }`
- `internal static string ShowISOCodes { get; }`
- `internal static string ShowISOStringBuilder { get; }`
- `internal static string ShowUserCodes { get; }`
- `internal static string SupportTransitional { get; }`
- `internal static string Transitory { get; }`
- `internal static string UseISOCodeFilterMapping { get; }`
- `internal static string UseUserCodes { get; }`
- `internal static string ValidateTestObjectAndPositionFields { get; }`
- Each property calls `ResourceManager.GetString(key, resourceCulture)` for its respective key (e.g., `"AllowNonISO"`).
---
### 3. **Invariants**
- **`_key` immutability**: Once set in the constructor, `_key` is never modified.
- **Fallback behavior**:
- Missing keys **always** return `"#stringnotfound#"` (empty key) or `"#stringnotfound# <key>"` (key not found in resources).
- No exceptions are thrown for missing keys or invalid input.
- **Thread-safety of `ResourceManager`**:
- The `ResourceManager` instance is lazily initialized and cached in a static field.
- `ResourceManager` is thread-safe for concurrent reads (per .NET documentation), but `Culture` setter is not explicitly synchronized.
- **Resource key consistency**:
- The keys used in `TranslateExtension` must match the property names in `StringResources` (e.g., `"AllowNonISO"`). Mismatches will trigger the fallback string.
---
### 4. **Dependencies**
#### **Depends on**
- `System.Windows.Markup.MarkupExtension` (WPF framework)
- `System.Resources.ResourceManager`
- `System.Globalization.CultureInfo`
- `System` (core types)
- `ISOSettings.Resources.StringResources` (strongly-typed resource class, same assembly)
#### **Used by**
- XAML files in the `ISOSettings` module (e.g., `*.xaml` files using `{local:Translate KeyName}`).
- Any UI component requiring localized strings (e.g., settings dialogs, labels, tooltips).
- *Not* used by non-UI or backend logic directly (resource access for non-XAML code should use `StringResources` directly).
---
### 5. **Gotchas**
- **No culture switching support in `TranslateExtension`**:
- The extension does not respect dynamic changes to `StringResources.Culture`. If the UI culture changes at runtime, the extension will not re-resolve strings unless the UI element is reloaded (e.g., via data binding refresh).
- *Workaround*: Bind to a property that raises `INotifyPropertyChanged` and re-creates the extension (not ideal).
- **Hardcoded fallback string**:
- `"#stringnotfound#"` is a visible placeholder in the UI if a key is missing. This is intentional for debugging but may confuse end users.
- **No validation of resource keys at compile time**:
- Typos in XAML (e.g., `{local:Translate Key="AllowNonISOo"}`) will silently fall back to `"#stringnotfound# AllowNonISOo"`.
- *Recommendation*: Use source-generated or compile-time-checked alternatives (e.g., `x:Static`) where possible.
- **Auto-generated resource class**:
- `StringResources.Designer.cs` is regenerated on build. Manual edits will be lost.
- Resource keys must be added/modified in the `.resx` file (not in the `.Designer.cs` file).
- **`IServiceProvider` unused**:
- The `serviceProvider` parameter in `ProvideValue` is ignored. This is acceptable for simple string resolution but prevents advanced scenarios (e.g., resolving context-aware translations).
- **No null-check on `ResourceManager.GetString()` result beyond `null`**:
- If `GetString()` returns an empty string (`""`), it is treated as valid (not replaced with fallback). This may be intentional or a bug depending on requirements.
- **No localization for non-WPF contexts**:
- This module is WPF-specific. Non-XAML code (e.g., console, tests) must use `StringResources` directly.
---
*Documentation generated from source files only. No external behavior or assumptions beyond the provided code.*

View File

@@ -0,0 +1,38 @@
---
source_files:
- DataPRO/Modules/SystemSettings/ISOSettings/View/ISOSettingsView.xaml.cs
generated_at: "2026-04-16T04:42:34.466996+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "4e8ae6c24b196f9d"
---
# View
### 1. **Purpose**
This module defines the WPF view class `ISOSettingsView`, which serves as the UI layer for the ISO settings feature. It implements the `IISOSettingsView` interface, indicating it adheres to a defined view contract—likely part of a MVVM (Model-View-ViewModel) or similar architectural pattern—enabling separation of UI logic from business logic. Its role is to provide the visual representation and user interaction surface for configuring ISO-related system settings, though the actual implementation details (e.g., data binding, command handling) are not present in this file and must reside elsewhere (e.g., in XAML or a ViewModel).
### 2. **Public Interface**
- **`ISOSettingsView()`**
*Signature:* `public ISOSettingsView()`
*Behavior:* Constructor that initializes the WPF component by calling `InitializeComponent()`, which loads and wires up the XAML-defined UI elements (from `ISOSettingsView.xaml`). No additional initialization logic is visible in the source.
### 3. **Invariants**
- The class must always be instantiated in a UI-thread context (as required by WPF), since `InitializeComponent()` interacts with UI elements.
- The `IISOSettingsView` interface contract (not shown here) is assumed to be satisfied, but no specific invariants (e.g., state transitions, required properties) can be inferred from this file alone.
### 4. **Dependencies**
- **External Dependencies:**
- `System.ComponentModel` (standard .NET namespace, likely for data binding or change notification support).
- `DTS.Common.Interface` (internal namespace containing the `IISOSettingsView` interface definition).
- **Internal Dependencies:**
- `ISOSettingsView.xaml` (implicit dependency—`InitializeComponent()` is auto-generated from this XAML file).
- `IISOSettingsView` interface (defined in `DTS.Common.Interface`), which this class implements.
- **Depended Upon By:**
- Likely a ViewModel or presenter (e.g., `ISOSettingsViewModel`) that holds a reference to `IISOSettingsView` for UI updates or interaction. Not visible in this file.
### 5. **Gotchas**
- **No logic in constructor**: The constructor performs only basic WPF initialization. Any complex setup (e.g., event subscriptions, ViewModel binding) must occur elsewhere (e.g., in XAML, `Loaded` event, or ViewModel).
- **Interface contract unknown**: While `IISOSettingsView` is implemented, its members and expected behavior are not defined here—refer to `DTS.Common.Interface` for full contract details.
- **No validation or error handling visible**: This file contains no business logic, so validation, error states, or user feedback mechanisms are absent here and must be handled in dependent layers.
- **None identified from source alone.**

View File

@@ -0,0 +1,116 @@
---
source_files:
- DataPRO/Modules/SystemSettings/ISOSettings/ViewModel/ISOSettingsViewModel.cs
generated_at: "2026-04-16T04:41:44.940794+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "3315a3b012311a0d"
---
# ViewModel
## Documentation: `ISOSettingsViewModel`
---
### **1. Purpose**
The `ISOSettingsViewModel` class serves as the MVVM-compliant view model for the ISO Settings module within the application. It acts as the intermediary between the `IISOSettingsView` (UI) and the `IISOSettingsModel` (data layer), managing UI state (e.g., busy status, dirty state, menu/navigation inclusion flags), handling user interactions via Prisms `InteractionRequest` pattern, and coordinating data loading and saving. It subscribes to global events (e.g., `RaiseNotification`, `BusyIndicatorChangeNotification`) to decouple cross-module communication and integrates with Prisms region management and Unity DI container for modular composition.
---
### **2. Public Interface**
#### **Constructor**
```csharp
public ISOSettingsViewModel(IISOSettingsView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
```
- Initializes the view model, sets up event subscriptions, instantiates `ISOSettingsModel`, loads initial data via `Model.LoadData()`, and assigns it to `ISOData`. Also sets `View.DataContext = ISOData`.
#### **Properties**
| Property | Type | Description |
|---------|------|-------------|
| `View` | `IISOSettingsView` | Reference to the associated view. Set externally (e.g., via Prism navigation). |
| `Model` | `IISOSettingsModel` | Reference to the data model used for loading/saving ISO settings. Initialized in constructor. |
| `ISOData` | `IISOSettingsData` | The current ISO settings data model. Raises `PropertyChanged` on change. |
| `IsBusy` | `bool` | Indicates whether a long-running operation is in progress. Bound to UI busy indicator. |
| `IsDirty` | `bool` | *Declared but never set* — no logic updates this property (see *Gotchas*). |
| `IsMenuIncluded` | `bool` | UI state flag indicating whether the menu section is included in the view. |
| `IsNavigationIncluded` | `bool` | UI state flag indicating whether the navigation section is included in the view. |
| `HeaderInfo` | `string` | Returns `"MainRegion"` — likely used for region naming or header labeling. |
#### **InteractionRequests**
| Property | Type | Description |
|---------|------|-------------|
| `NotificationRequest` | `InteractionRequest<Notification>` | Triggers display of notification popups (e.g., alerts). |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Triggers confirmation dialogs (e.g., "Are you sure?"). |
#### **Methods**
| Method | Signature | Description |
|--------|-----------|-------------|
| `SaveData` | `public void SaveData()` | Delegates saving of `ISOData` to `Model.SaveData(ISOData)`. |
| `Cleanup` | `public void Cleanup()` | No-op stub. |
| `CleanupAsync` | `public Task CleanupAsync()` | Returns `Task.CompletedTask`. |
| `Initialize` | `public void Initialize()` / `Initialize(object)` / `Initialize(object, object)` | All no-op stubs. |
| `InitializeAsync` | `public Task InitializeAsync()` / `InitializeAsync(object)` | All return `Task.CompletedTask`. |
| `Activated` | `public void Activated()` | No-op stub. |
#### **Event Handling**
| Method | Signature | Description |
|--------|-----------|-------------|
| `OnBusyIndicatorNotification` | `private void OnBusyIndicatorNotification(bool eventArg)` | Sets `IsBusy = eventArg`. |
| `OnRaiseNotification` | `private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)` | Converts `NotificationContentEventArgs` to `Notification` and raises `NotificationRequest`. |
| `OnPropertyChanged` | `public void OnPropertyChanged(string propertyName)` | Raises `PropertyChanged` event for the specified property. |
#### **Interface Implementation**
- Implements `INotifyPropertyChanged` (via `PropertyChanged` event and `OnPropertyChanged`).
- Exports as `[Export(typeof(IISOSettingsView))]`*note: this is likely a misnomer; should be `IISOSettingsViewModel`* (see *Gotchas*).
---
### **3. Invariants**
- `ISOData` must be non-null after construction (initialized via `Model.LoadData()`).
- `View.DataContext` is always set to `ISOData` in the constructor.
- `IsBusy` is updated exclusively via `OnBusyIndicatorNotification(bool)`, triggered by `BusyIndicatorChangeNotification` events.
- `NotificationRequest` is raised only via `OnRaiseNotification(NotificationContentEventArgs)`, which wraps the event args in a `Notification` object with `Content` and `Title`.
- `Model` is instantiated once in the constructor and never reassigned.
- `IsMenuIncluded` and `IsNavigationIncluded` are boolean flags with no validation logic — their values are arbitrary until set by external code (e.g., view or user interaction).
---
### **4. Dependencies**
#### **Imports / Dependencies**
- **Prism Framework**: `IEventAggregator`, `IRegionManager`, `InteractionRequest<T>`, `Notification`, `Confirmation`.
- **Unity DI Container**: `IUnityContainer`.
- **Custom Interfaces**:
- `IISOSettingsView` (view interface)
- `IISOSettingsModel` (data model interface)
- `IISOSettingsData` (data contract for ISO settings)
- **Custom Events**:
- `RaiseNotification` (event type, likely from `DTS.Common.Events`)
- `BusyIndicatorChangeNotification` (event type, likely from `DTS.Common.Events`)
- **Namespaces**:
- `DTS.Common.Events`, `DTS.Common.Interactivity`, `DTS.Common.Interface`
- `ISOSettings.Model`
#### **Depended Upon**
- The module exports `ISOSettingsViewModel` as `IISOSettingsView` — suggesting it is consumed by Prisms region navigation system as a view (though the export type is likely incorrect).
- Other modules may publish `RaiseNotification` or `BusyIndicatorChangeNotification` events to trigger UI feedback.
---
### **5. Gotchas**
- **Export Type Mismatch**: The class is decorated with `[Export(typeof(IISOSettingsView))]`, but it implements `IISOSettingsViewModel`. This is likely a bug — the export should be `typeof(IISOSettingsViewModel)` to align with Prism conventions and avoid runtime resolution errors.
- **`IsDirty` is Unused**: The `IsDirty` property is declared but never updated. No logic sets it to `true` (e.g., on data change), so it will always remain `false`.
- **No Validation on Save**: `SaveData()` directly passes `ISOData` to `Model.SaveData()` without validation or error handling in the view model.
- **Event Handler Logic is Fragile**: `OnRaiseNotification` constructs a new `NotificationContentEventArgs("", "", ...)` with empty strings for `Title2` and `Image2`, but the comment implies the `Notification` object expects a `NotificationContentEventArgsWithoutTitle` — this suggests a mismatch between the event args type and the expected payload, risking runtime issues if `NotificationContentEventArgs` is not compatible.
- **No Cleanup Logic**: `Cleanup()` and `CleanupAsync()` are empty. If `ISOSettingsViewModel` subscribes to long-lived events (e.g., `RaiseNotification`), it should unsubscribe in `Cleanup()` to prevent memory leaks — though Prisms `EventAggregator` uses weak references by default, so this may be mitigated.
- **`Activated()` is a No-op**: The `IRegionMemberLifetime` or Prism lifecycle hooks (`Activated`, `Deactivated`) are not utilized beyond stubs.
- **Thread Safety**: `OnBusyIndicatorNotification` uses `ThreadOption.PublisherThread`, but no other thread-safety guarantees are documented for `IsBusy` or `ISOData` access.
---
*Documentation generated from source file `DataPRO/Modules/SystemSettings/ISOSettings/ViewModel/ISOSettingsViewModel.cs`.*

View File

@@ -0,0 +1,110 @@
---
source_files:
- DataPRO/Modules/SystemSettings/PowerAndBattery/PowerAndBatteryModule.cs
generated_at: "2026-04-16T04:39:36.503706+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "db7e4da125c7a0e8"
---
# PowerAndBattery
## Documentation: PowerAndBatteryModule
---
### **Purpose**
The `PowerAndBatteryModule` is a Prism-based modular component responsible for registering the view and view model for the Power & Battery feature within the applications UI. It enables lazy loading and dependency injection integration for the `PowerAndBatteryView` and `PowerAndBatteryViewModel` types via the Unity container. Additionally, it contributes metadata (specifically image and grouping information) to the main UI for visual identification and categorization of this module.
---
### **Public Interface**
#### **`PowerAndBatteryModule` Class**
- **`PowerAndBatteryModule(IUnityContainer unityContainer)`**
Constructor. Accepts a Unity container via dependency injection and stores it for later use in type registration.
- **`void Initialize()`**
Registers two interfaces to their concrete implementations as singleton types in the Unity container:
- `IPowerAndBatteryView``PowerAndBatteryView`
- `IPowerAndBatteryViewModel``PowerAndBatteryViewModel`
This method is called both directly during module initialization and indirectly via `RegisterTypes`.
- **`void OnInitialized(IContainerProvider containerProvider)`**
Currently empty. No logic is executed during Prisms `OnInitialized` pipeline phase.
- **`void RegisterTypes(IContainerRegistry containerRegistry)`**
Delegates to `Initialize()` (which uses the injected `_unityContainer`, *not* `containerRegistry`).
⚠️ **Note**: The `containerRegistry` parameter is unused; registration occurs on the pre-injected `_unityContainer`, which may be inconsistent with Prisms intended `IContainerRegistry` usage.
#### **`PowerAndBatteryImageAttribute` Class**
- **`PowerAndBatteryImageAttribute()`**
Default constructor. Calls the overloaded constructor with `null`.
- **`PowerAndBatteryImageAttribute(string s)`**
Constructor accepting a string (unused in implementation). Loads and caches the assembly image via `AssemblyInfo.GetImage(AssemblyNames.PowerAndBattery.ToString())`.
- **`override BitmapImage AssemblyImage { get; }`**
Returns the cached `BitmapImage` loaded from the assembly resource for the PowerAndBattery module.
- **`override BitmapImage GetAssemblyImage()`**
Returns the value of `AssemblyImage`.
- **`override string AssemblyName { get; }`**
Returns `"PowerAndBattery"` (via `AssemblyNames.PowerAndBattery.ToString()`).
- **`override string GetAssemblyName()`**
Returns the value of `AssemblyName`.
- **`override string AssemblyGroup { get; }`**
Returns `"Administrative"` (via `eAssemblyGroups.Administrative.ToString()`).
- **`override string GetAssemblyGroup()`**
Returns the value of `AssemblyGroup`.
- **`override eAssemblyRegion AssemblyRegion { get; }`**
Throws `NotImplementedException`. *Always throws*; never returns a value.
- **`override eAssemblyRegion GetAssemblyRegion()`**
Delegates to `AssemblyRegion`, thus also throws `NotImplementedException`.
- **`override Type GetAttributeType()`**
Returns `typeof(ImageAttribute)`.
---
### **Invariants**
- The `PowerAndBatteryModule` must be loaded *after* the Unity container is available and *before* views/view models are resolved.
- `IPowerAndBatteryView` and `IPowerAndBatteryViewModel` must be registered exactly once per module load (enforced by singleton registration).
- `AssemblyImage` and `AssemblyName` are immutable after first access (cached in private fields `_img`, `_name`, `_group`).
- `AssemblyGroup` is *always* `"Administrative"` (hardcoded).
- `AssemblyRegion` and `GetAssemblyRegion()` are *never* functional — they always throw `NotImplementedException`.
---
### **Dependencies**
#### **Module Depends On**
- `Unity.IUnityContainer` — for type registration.
- `Prism.Modularity.IModule` — base interface for Prism modules.
- `DTS.Common` — specifically:
- `AssemblyInfo.GetImage(...)`
- `AssemblyNames.PowerAndBattery`
- `eAssemblyGroups.Administrative`
- `System.Windows.Media.Imaging.BitmapImage` — for image metadata.
- `System.ComponentModel.Composition.ExportAttribute` — for Prism module discovery.
#### **Module Is Used By**
- Prisms module catalog/loader (via `[Export(typeof(IModule))]` and `[Module(...)]` attributes).
- The main UI layer — via `PowerAndBatteryImageAttribute` applied at the assembly level (inferred from XML doc comment: *“used on the Main screen to display available components”*).
---
### **Gotchas**
- **`RegisterTypes` ignores its parameter**: The method accepts `IContainerRegistry containerRegistry` but internally calls `Initialize()`, which uses the injected `_unityContainer`. This is inconsistent with Prisms design (where `IContainerRegistry` is the expected registration mechanism) and may cause issues if the module is used in a non-Unity Prism environment or if `containerRegistry` is expected to be used.
- **`AssemblyRegion` is non-functional**: Both `AssemblyRegion` and `GetAssemblyRegion()` throw `NotImplementedException`. Any UI logic relying on region classification will fail at runtime.
- **Redundant field assignments**: Private fields (`_img`, `_name`, `_group`) are assigned in both the property getter and constructor, but the getter always returns the cached value — the constructor assignment is redundant.
- **Unused constructor parameter in `PowerAndBatteryImageAttribute(string s)`**: The `string s` parameter is never used.
- **No validation on image loading**: `AssemblyInfo.GetImage(...)` may throw if the assembly resource is missing or malformed; no error handling is present.
None identified beyond the above.

View File

@@ -0,0 +1,52 @@
---
source_files:
- DataPRO/Modules/SystemSettings/PowerAndBattery/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T04:41:19.217178+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "7315bc849a145f3a"
---
# Properties
### **1. Purpose**
This module is an assembly-level metadata definition for a component named **PowerAndBattery**, part of the `DataPRO` systems SystemSettings module. It provides .NET assembly attributes that define identity, versioning, and COM visibility information for the compiled module. It does not contain any executable logic or business functionality; its sole purpose is to configure metadata used by the .NET runtime and build/deployment tooling.
---
### **2. Public Interface**
This file contains **no public types, functions, classes, or methods**. It is a pure metadata assembly file (`AssemblyInfo.cs`) and defines only assembly-level attributes via `Assembly` attributes. All content is declarative and non-executable.
---
### **3. Invariants**
- The assembly is **not COM-visible** (`ComVisible(false)`), meaning its types cannot be accessed from COM clients unless explicitly exposed.
- The assemblys identity is fixed as `PowerAndBattery`, with version `1.0.0.0` for both `AssemblyVersion` and `AssemblyFileVersion`.
- The `Guid` attribute (`7446722e-490d-4f6a-beaf-907947e576d5`) uniquely identifies the typelib for COM interop purposes, though COM visibility is disabled.
- No runtime invariants or stateful constraints apply, as this file contains no logic.
---
### **4. Dependencies**
- **Depends on**:
- `System.Reflection`
- `System.Runtime.CompilerServices`
- `System.Runtime.InteropServices`
(All standard .NET framework namespaces, implicitly available.)
- **Depended on by**:
- The build system (to embed metadata into the compiled assembly).
- Any consumer of the compiled `PowerAndBattery.dll` assembly (e.g., via reflection or COM interop, though COM access is disabled).
- Internal tooling or deployment scripts that rely on assembly identity/versioning.
No other source files or modules are referenced in this file.
---
### **5. Gotchas**
- **No executable code**: Developers may mistakenly expect logic here; this file is *only* for assembly metadata and must be paired with other source files (not shown) that implement the actual power/battery functionality.
- **COM disabled**: Despite the presence of a `Guid`, COM interop is disabled (`ComVisible(false)`), so the GUID has no practical effect unless `ComVisible(true)` is set elsewhere (e.g., in project-level settings or another `AssemblyInfo`).
- **Versioning**: Both `AssemblyVersion` and `AssemblyFileVersion` are hardcoded to `1.0.0.0`. If versioning is managed externally (e.g., via CI/CD), this may cause confusion or require manual updates.
- **Empty `AssemblyDescription` and `AssemblyCompany`**: These fields are blank, which may be intentional but could complicate diagnostics or metadata inspection.
None identified beyond the above.

View File

@@ -0,0 +1,36 @@
---
source_files:
- DataPRO/Modules/SystemSettings/PowerAndBattery/View/PowerAndBatteryView.xaml.cs
generated_at: "2026-04-16T04:41:24.960760+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "5fdffb7943280988"
---
# View
### 1. **Purpose**
This module provides the WPF view layer for the *PowerAndBattery* feature, implementing the `IPowerAndBatteryView` interface to support UI presentation of power and battery-related settings. It serves as the visual container (likely bound to `PowerAndBatteryView.xaml`) and participates in a MVVM or similar UI architecture where the view is decoupled from business logic via interface abstraction.
### 2. **Public Interface**
- **`PowerAndBatteryView()`**
Constructor. Calls `InitializeComponent()` to instantiate and wire up the XAML-defined UI elements. No additional initialization logic is present in the provided source.
### 3. **Invariants**
- The class must be instantiated only on the UI thread (inferred from WPF `UserControl`/`Window` semantics and `InitializeComponent()` usage).
- `InitializeComponent()` must be called exactly once during construction; subsequent calls are not expected or safe (standard WPF behavior).
- The class implements `IPowerAndBatteryView`, implying conformance to that interfaces contract (though interface definition is external and not provided here).
### 4. **Dependencies**
- **External**:
- `DTS.Common.Interface` (namespace) — specifically depends on `IPowerAndBatteryView` (interface defined elsewhere).
- WPF framework (implicit via `partial class` and `InitializeComponent()`).
- **Internal**:
- `PowerAndBatteryView.xaml` (code-behind file is partial, so tightly coupled to its XAML counterpart).
- No other modules or services are referenced directly in the provided source.
### 5. **Gotchas**
- The class is minimal and contains no logic beyond constructor/XAML initialization; complex behavior (e.g., data binding, event handling) resides in the XAML file or a separate view model/controller.
- No error handling or validation is visible in this file — failures in `InitializeComponent()` (e.g., missing XAML resources) will surface as runtime exceptions.
- The `IPowerAndBatteryView` interface contract is not defined here; its members (e.g., properties, methods) are unknown and must be referenced externally to understand full usage.
- None identified from source alone.

View File

@@ -0,0 +1,163 @@
---
source_files:
- DataPRO/Modules/SystemSettings/PowerAndBattery/ViewModel/PowerAndBatteryViewModel.cs
generated_at: "2026-04-16T04:41:22.608181+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "734fcb6778e8ee9f"
---
# ViewModel
## Documentation: PowerAndBatteryViewModel
### 1. Purpose
The `PowerAndBatteryViewModel` serves as the view model for the Power and Battery settings module within the applications UI. It acts as the intermediary between the `IPowerAndBatteryView` and underlying system services (e.g., event aggregation, region navigation, dependency injection), enabling reactive UI behavior through Prisms interaction patterns (e.g., notifications, busy indicators). It subscribes to global events (`RaiseNotification`, `BusyIndicatorChangeNotification`) to synchronize UI state (e.g., busy status, popup notifications) and exposes properties (`IsBusy`, `IsDirty`, `IsMenuIncluded`, etc.) that control view presentation. Though currently minimal in implementation, it is designed to support future power/battery-specific logic.
---
### 2. Public Interface
#### `PowerAndBatteryViewModel` Constructor
```csharp
public PowerAndBatteryViewModel(
IPowerAndBatteryView view,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
```
Initializes the view model, assigns the provided `view` and sets its `DataContext` to `this`. Registers event subscriptions for `RaiseNotification` and `BusyIndicatorChangeNotification` events via `_eventAggregator`. Initializes `NotificationRequest` and `ConfirmationRequest` for Prism interaction patterns.
#### `Cleanup()`
```csharp
public void Cleanup()
```
No-op stub. Intended for cleanup logic (e.g., unsubscribing from events, releasing resources), but currently does nothing.
#### `CleanupAsync()`
```csharp
public Task CleanupAsync()
```
Returns `Task.CompletedTask`. No-op stub for async cleanup.
#### `Initialize()`
```csharp
public void Initialize()
```
No-op stub. Intended for initialization logic.
#### `Initialize(object parameter)`
```csharp
public void Initialize(object parameter)
```
No-op stub. Intended for parameterized initialization.
#### `Initialize(object parameter, object model)`
```csharp
public void Initialize(object parameter, object model)
```
No-op stub. Intended for initialization with both navigation parameter and domain model.
#### `InitializeAsync()`
```csharp
public Task InitializeAsync()
```
Returns `Task.CompletedTask`. No-op stub for async initialization.
#### `InitializeAsync(object parameter)`
```csharp
public Task InitializeAsync(object parameter)
```
Returns `Task.CompletedTask`. No-op stub for async parameterized initialization.
#### `Activated()`
```csharp
public void Activated()
```
No-op stub. Likely intended for Prism `INavigationAware.Activated` lifecycle hook.
#### `NotificationRequest`
```csharp
public InteractionRequest<Notification> NotificationRequest { get; }
```
Exposes a Prism `InteractionRequest` for triggering notification popups (e.g., informational messages). Triggered via `OnRaiseNotification`.
#### `ConfirmationRequest`
```csharp
public InteractionRequest<Confirmation> ConfirmationRequest { get; }
```
Exposes a Prism `InteractionRequest` for confirmation dialogs (e.g., yes/no prompts). Currently unused in the source.
#### `IsBusy`
```csharp
public bool IsBusy { get; set; }
```
Gets/sets the busy state. Bound to UI to show/hide a busy indicator. Set via `OnBusyIndicatorNotification`.
#### `IsDirty`
```csharp
public bool IsDirty { get; private set; }
```
Read-only property indicating whether the view models state has unsaved changes. Always `false` in current implementation.
#### `IsMenuIncluded`
```csharp
public bool IsMenuIncluded { get; set; }
```
Controls whether the main menu is visible in the view. Defaults to `false`.
#### `IsNavigationIncluded`
```csharp
public bool IsNavigationIncluded { get; set; }
```
Controls whether navigation controls are visible in the view. Defaults to `false`.
#### `HeaderInfo`
```csharp
public string HeaderInfo => "MainRegion";
```
Read-only property returning the literal string `"MainRegion"`. Likely used for view header identification or region targeting.
---
### 3. Invariants
- `View.DataContext` is always set to `this` during construction.
- `IsBusy` is updated synchronously via `SetProperty` when `BusyIndicatorChangeNotification` is raised.
- `NotificationRequest` is always initialized with a `Notification` object containing a `NotificationContentEventArgs` (with empty `OkText` and `CancelText`) and the original events `Title`.
- The view model is a shared singleton (`[PartCreationPolicy(CreationPolicy.Shared)]`), meaning only one instance exists per application lifetime.
- `IsDirty` is never set to `true` in the current implementation (always `false`).
---
### 4. Dependencies
#### Dependencies *on* this module:
- `IPowerAndBatteryView` (interface) — the view bound to this view model.
- `IPowerAndBatteryViewModel` (interface) — the contract implemented by this class.
- `PowerAndBattery` namespace — the modules own namespace (inferred from `namespace PowerAndBattery`).
#### Dependencies *of* this module:
- `DTS.Common.Base` — provides `BasePropertyChanged` (base class for property change notification).
- `DTS.Common.Events` — provides `RaiseNotification`, `BusyIndicatorChangeNotification`, `NotificationContentEventArgs`.
- `DTS.Common.Interactivity` — provides `InteractionRequest<T>` and related types (e.g., `Notification`, `Confirmation`).
- `DTS.Common.Interface` — likely contains interfaces like `IPowerAndBatteryView`, `IPowerAndBatteryViewModel`.
- `Prism.Events` — provides `IEventAggregator` and event types.
- `Prism.Regions` — provides `IRegionManager`.
- `Unity` — provides `IUnityContainer`.
#### Dependencies *of* this modules consumers:
- Any consumer must provide `IPowerAndBatteryView`, `IRegionManager`, `IEventAggregator`, and `IUnityContainer` via DI.
- Consumers must publish `RaiseNotification` and `BusyIndicatorChangeNotification` events via `IEventAggregator` to interact with this view model.
---
### 5. Gotchas
- **Empty `Cleanup()`/`Initialize()` implementations**: All lifecycle methods (`Cleanup`, `Initialize*`, `Activated`) are no-ops. This may indicate incomplete implementation or deferred logic.
- **Unused `ConfirmationRequest`**: Declared but never raised; may be leftover from scaffolding or future use.
- **`IsDirty` never updated**: Always `false`; if intended for dirty-state tracking, logic is missing.
- **`HeaderInfo` is hardcoded**: Returns `"MainRegion"` literally — may be fragile if region names change.
- **Event handler naming mismatch**: `OnBusyIndicatorNotification` is documented as handling `RaiseNotification` in its XML comment, but actually handles `BusyIndicatorChangeNotification`.
- **`NotificationContentEventArgs` construction**: The `OnRaiseNotification` handler creates a new `NotificationContentEventArgs` with empty `OkText` and `CancelText` fields — this may be intentional (e.g., to suppress confirmation buttons) but is not documented.
- **Thread safety**: `OnBusyIndicatorNotification` uses `ThreadOption.PublisherThread`, but `OnRaiseNotification` uses the default (likely background thread). If UI updates occur in `OnRaiseNotification`, this could cause cross-thread exceptions (though `NotificationRequest.Raise` likely marshals to UI thread).
None identified beyond the above.

View File

@@ -0,0 +1,113 @@
---
source_files:
- DataPRO/Modules/SystemSettings/QASettings/QASettingsModule.cs
generated_at: "2026-04-16T04:39:47.144121+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "c77c52ad81731c25"
---
# QASettings
### **Purpose**
The `QASettingsModule` is a Prism module responsible for bootstrapping and registering the QA Settings feature within the applications modular architecture. It integrates with Unity as the dependency injection container to register the view (`IQASettingsView`) and view model (`IQASettingsViewModel`) as singleton services, enabling their later resolution and composition into the UI. Additionally, it exposes metadata about the module (e.g., display name, group, and icon) via the `QASettingsImageAttribute`, which is applied at the assembly level and consumed by the main UI to render the module in component selection interfaces.
---
### **Public Interface**
#### **Class: `QASettingsModule`**
- **`QASettingsModule(IUnityContainer unityContainer)`**
Constructor. Accepts a Unity container via dependency injection and stores it for later use in type registration.
- **`void Initialize()`**
Registers the view and view model types as singletons in the Unity container:
- `IQASettingsView``QASettingsView`
- `IQASettingsViewModel``QASettingsViewModel`
- **`void OnInitialized(IContainerProvider containerProvider)`**
Currently empty; no initialization logic executed during Prisms module initialization lifecycle.
- **`void RegisterTypes(IContainerRegistry containerRegistry)`**
Delegates to `Initialize()`, performing the same type registrations. This method is part of Prisms `IModule` interface contract and is invoked by the Prism framework during module loading.
#### **Class: `QASettingsImageAttribute`**
*(Inherits from `ImageAttribute` — assumed defined elsewhere in `DTS.Common`)*
- **`QASettingsImageAttribute()`**
Default constructor; delegates to the parameterized constructor with `null`.
- **`QASettingsImageAttribute(string s)`**
Constructor accepting an unused `string` parameter; initializes `_img` by calling `AssemblyInfo.GetImage(AssemblyNames.QASettings.ToString())`.
- **`override eAssemblyRegion AssemblyRegion`**
Property getter throws `NotImplementedException`.
- **`override BitmapImage AssemblyImage`**
Returns a `BitmapImage` obtained by calling `AssemblyInfo.GetImage("QASettings")`. Caches the result in `_img` on first access.
- **`override Type GetAttributeType()`**
Returns `typeof(ImageAttribute)`.
- **`override BitmapImage GetAssemblyImage()`**
Returns the value of `AssemblyImage`.
- **`override string AssemblyName`**
Property getter returns `"QASettings"` (via `AssemblyNames.QASettings.ToString()`). Caches in `_name`.
- **`override string GetAssemblyName()`**
Returns the value of `AssemblyName`.
- **`override eAssemblyRegion GetAssemblyRegion()`**
Throws `NotImplementedException`.
- **`override string AssemblyGroup`**
Property getter returns `"Administrative"` (via `eAssemblyGroups.Administrative.ToString()`). Caches in `_group`.
- **`override string GetAssemblyGroup()`**
Returns the value of `AssemblyGroup`.
> **Note**: All `NotImplementedException`-throwing members (`AssemblyRegion`, `GetAssemblyRegion`, `GetAssemblyRegion`) are present but unimplemented. Their behavior is undefined at runtime.
---
### **Invariants**
- The `QASettingsModule` **must** be loaded by the Prism module catalog for the view/view model registrations to take effect.
- `AssemblyInfo.GetImage(AssemblyNames.QASettings.ToString())` **must succeed** during `QASettingsImageAttribute` construction; otherwise, a runtime exception occurs (e.g., `NullReferenceException` if `AssemblyInfo.GetImage` returns `null`).
- `AssemblyNames.QASettings` and `eAssemblyGroups.Administrative` **must be defined** in referenced assemblies (`DTS.Common`); otherwise, compilation fails.
- `QASettingsView` and `QASettingsViewModel` **must implement** `IQASettingsView` and `IQASettingsViewModel` respectively, and be resolvable via Unity.
- The `QASettingsImageAttribute` is applied **once per assembly** (due to `AllowMultiple = false`).
---
### **Dependencies**
#### **Module Dependencies**
- **`DTS.Common`**
Provides:
- `AssemblyInfo`, `AssemblyNames`, `eAssemblyGroups`
- Base `ImageAttribute` class
- `IQASettingsView`, `IQASettingsViewModel` interfaces
- **`Prism.Modularity`**
Provides `IModule` interface.
- **`Prism.Ioc`**
Provides `IContainerRegistry`, `IContainerProvider`.
- **`Unity`**
Provides `IUnityContainer`.
- **`System.Windows.Media.Imaging`**
Provides `BitmapImage`.
#### **Module Consumers**
- The Prism bootstrapper/module catalog (implicit consumer).
- UI components that resolve `IQASettingsView` or `IQASettingsViewModel` via Unity.
- The main application shell (e.g., `ShellView`) likely uses `QASettingsImageAttribute` metadata to display the module in a component selector.
---
### **Gotchas**
- **`AssemblyRegion` and `GetAssemblyRegion()` throw `NotImplementedException`**: Any code attempting to access these members (e.g., UI rendering logic) will crash at runtime. This suggests incomplete implementation or legacy code.
- **Unused `string` parameter in `QASettingsImageAttribute(string s)`**: The parameter is accepted but never used; likely a remnant of refactoring or base-class requirements.
- **Caching in `AssemblyImage` and `AssemblyName`**: While `_img`, `_name`, and `_group` are cached, the properties are not thread-safe. Concurrent access during initialization could lead to race conditions (though unlikely given typical single-threaded Prism module loading).
- **No validation in `Initialize()`**: Assumes `IQASettingsView` and `IQASettingsViewModel` are resolvable by Unity. If their dependencies are unregistered, resolution will fail at runtime (not compile time).
- **No `OnInitialized` logic**: The empty `OnInitialized` method may indicate pending functionality or unused Prism lifecycle hooks.
None identified beyond the above.

View File

@@ -0,0 +1,32 @@
---
source_files:
- DataPRO/Modules/SystemSettings/QASettings/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T04:40:01.043674+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "96ed3ef07324540f"
---
# Properties
## 1. Purpose
This module is the `AssemblyInfo` configuration file for the `QASettings` .NET assembly. Its purpose is to define metadata for the assembly—such as title, version, and COM visibility—used by the .NET runtime and build/deployment tooling. It does not contain application logic or runtime behavior; it solely provides declarative assembly-level attributes required for identification, versioning, and interoperability.
## 2. Public Interface
This file contains **no public functions, classes, or methods**. It defines only assembly-level attributes via attributes applied to the assembly itself (e.g., `[assembly: AssemblyTitle(...)]`). These are compile-time metadata directives, not runtime-accessible members.
## 3. Invariants
- The assembly is **not visible to COM** (`ComVisible(false)`), meaning it cannot be consumed by COM clients unless explicitly overridden elsewhere (e.g., on specific types).
- The assembly version is fixed at `1.0.0.0` for both `AssemblyVersion` and `AssemblyFileVersion`. No wildcard (`*`) expansion is used for build/revision numbers.
- The `Guid` attribute (`7446722e-490d-4f6a-beaf-907947e576d5`) uniquely identifies the typelib for COM interop, though COM visibility is disabled—this GUID is effectively unused unless `ComVisible(true)` is set elsewhere or at type level.
- All string attributes (e.g., `AssemblyCompany`, `AssemblyDescription`) are present but empty or minimal; no semantic constraints are enforced beyond syntax.
## 4. Dependencies
- **Dependencies**: None (beyond standard .NET framework assemblies implied by `System.Reflection`, `System.Runtime.CompilerServices`, and `System.Runtime.InteropServices` namespaces—these are part of the base class library and do not constitute external dependencies).
- **Dependents**: This file contributes metadata to the `QASettings` assembly, which is presumably referenced by other modules in the `DataPRO` system (e.g., UI or service layers consuming QA settings). However, the `AssemblyInfo.cs` file itself has no direct runtime dependents—its metadata is consumed by tooling (e.g., MSBuild, reflection APIs, Windows registry for COM registration).
## 5. Gotchas
- **Unused GUID**: The `Guid` attribute is set, but since `ComVisible(false)` is applied at the assembly level, the GUID will not be used for COM registration unless specific types within the assembly are marked `[ComVisible(true)]`. This may cause confusion during COM interop setup.
- **Static versioning**: Version `1.0.0.0` is hardcoded; no automatic build/revision incrementing occurs (e.g., via `AssemblyVersion("1.0.*")`). This may conflict with CI/CD practices expecting dynamic versioning.
- **Empty metadata fields**: Attributes like `AssemblyDescription`, `AssemblyCompany`, and `AssemblyTrademark` are empty strings. This is acceptable but may reduce clarity for support or diagnostics tools that rely on assembly metadata.
- **No code logic**: Developers may mistakenly expect this file to contain executable logic; it is purely metadata. No runtime behavior or configuration loading occurs here.

View File

@@ -0,0 +1,34 @@
---
source_files:
- DataPRO/Modules/SystemSettings/QASettings/View/QASettingsView.xaml.cs
generated_at: "2026-04-16T04:40:07.723422+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "15ebc3fce78d948f"
---
# View
1. **Purpose**
This module defines the WPF view class `QASettingsView`, which serves as the UI layer for the Quality Assurance (QA) settings interface. It implements the `IQASettingsView` interface (from `DTS.Common.Interface`) and is responsible for rendering the XAML-defined UI (`QASettingsView.xaml`) for configuring QA-related application settings. Its role is purely presentational—handling UI initialization and delegating logic to a corresponding view model (not shown here).
2. **Public Interface**
- **`QASettingsView()`**
Public parameterless constructor. Calls `InitializeComponent()` to instantiate and wire up the XAML-defined UI elements. No additional initialization logic is present in the provided source.
3. **Invariants**
- The class must be instantiated on the UI thread (as it is a WPF `UserControl`/`Window`-derived type, inferred from `InitializeComponent()` usage), though the exact base type is not visible in this snippet.
- `InitializeComponent()` must be called exactly once during construction; calling it multiple times or after construction may cause runtime exceptions or undefined behavior (standard WPF pattern, but not explicitly enforced in this code).
- No validation, state mutation, or business logic is present in this class—therefore, no domain-specific invariants apply here.
4. **Dependencies**
- **External dependency**: `DTS.Common.Interface.IQASettingsView` — this interface defines the contract for the QA settings view (e.g., properties/events for data binding or command wiring), but its definition is not included here.
- **Internal dependency**: `QASettingsView.xaml` — the partial class relies on the corresponding XAML file for UI definition and element naming.
- **Framework dependency**: WPF (`System.Windows`, `System.Windows.Controls`, etc., implicitly via `InitializeComponent()`).
- **Inferred consumers**: A view model (likely `QASettingsViewModel`, not shown) that binds to this view via `DataContext`. No direct references to other modules are visible in this file.
5. **Gotchas**
- The class is a minimal stub—no logic, properties, or event handlers are implemented in the provided source. Behavior is entirely defined in `QASettingsView.xaml` and/or a separate view model.
- The interface `IQASettingsView` is not defined here; its contract (e.g., required properties or methods) must be consulted separately to understand expected usage.
- No null-safety or error handling is present in the constructor; failure in `InitializeComponent()` (e.g., missing XAML resources) will result in a runtime exception.
- None identified from source alone.

View File

@@ -0,0 +1,147 @@
---
source_files:
- DataPRO/Modules/SystemSettings/QASettings/ViewModel/QASettingsViewModel.cs
generated_at: "2026-04-16T04:41:41.270479+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "26d85367d0fdc737"
---
# ViewModel
## Documentation: QASettingsViewModel
---
### 1. Purpose
The `QASettingsViewModel` serves as the view model for the QA Settings module in the application, implementing the `IQASettingsViewModel` interface and adhering to Prisms MVVM pattern. It acts as the intermediary between the `IQASettingsView` UI and underlying system services (e.g., event aggregation, region management, dependency injection), enabling UI-driven interactions such as displaying notifications, managing busy state, and exposing configuration-related properties (e.g., counts of sensors, test setups). It also subscribes to global events (`RaiseNotification`, `BusyIndicatorChangeNotification`) to synchronize UI state with application-wide events.
---
### 2. Public Interface
#### `QASettingsViewModel` (class)
- **`IQASettingsView View { get; }`**
Reference to the associated view instance; set during construction and used to bind `DataContext`.
- **`InteractionRequest<Notification> NotificationRequest { get; }`**
Prism interaction request used to trigger notification popups (e.g., informational messages). Raised via `OnRaiseNotification`.
- **`InteractionRequest<Confirmation> ConfirmationRequest { get; }`**
Prism interaction request used to trigger confirmation dialogs (currently declared but not used in the provided source).
- **`bool IsBusy { get; set; }`**
Indicates whether the view/model is currently performing a long-running operation. Bound to a busy indicator in the UI.
- **`bool IsDirty { get; }`**
Property indicating whether changes have been made (currently always `false`; no logic implemented to set it).
- **`bool IsMenuIncluded { get; set; }`**
Controls visibility of the menu in the view (default `false`).
- **`bool IsNavigationIncluded { get; set; }`**
Controls visibility of navigation controls in the view (default `false`).
- **`string HeaderInfo { get; }`**
Returns the literal string `"MainRegion"`; likely used as a header or region identifier.
- **`string NumberOfSensorModelsText { get; set; }`**
String representation of `_numberOfSensorModels` (formatted with thousand separators); setter parses input to `int`.
- **`string NumberOfTestSetupsText { get; set; }`**
String representation of `_numberOfTestSetups`.
- **`string NumberOfGroupsText { get; set; }`**
String representation of `_numberOfGroups`.
- **`string NumberOfSensorsText { get; set; }`**
String representation of `_numberOfSensors`.
- **`string NumberOfGroupTemplatesText { get; set; }`**
String representation of `_numberOfGroupTemplates`.
- **`DelegateCommand CreateCommand { get; }`**
Command bound to a UI action (e.g., a button). Invokes `CreateMethod()` asynchronously (note: `async void`—see *Gotchas*).
#### Interface Implementations
- **`void Cleanup()` / `Task CleanupAsync()`**
No-op stubs; no cleanup logic implemented.
- **`void Initialize()` / `void Initialize(object parameter)` / `void Initialize(object parameter, object model)` / `Task InitializeAsync()` / `Task InitializeAsync(object parameter)`**
No-op stubs; no initialization logic implemented.
- **`void Activated()`**
No-op stub; likely part of Prisms `INavigationAware` or custom lifecycle interface.
- **`event PropertyChangedEventHandler PropertyChanged`**
Standard `INotifyPropertyChanged` implementation; used for data binding.
- **`void OnPropertyChanged(string propertyName)`**
Raises `PropertyChanged` event for the given property.
- **`bool SetProperty<T>(ref T storage, T value, string propertyName = null)`**
Declared but throws `NotImplementedException`; not used.
- **`void IBasePropertyChanged.OnPropertyChanged(string propertyName)`**
Explicit interface implementation of `IBasePropertyChanged.OnPropertyChanged`, delegating to `OnPropertyChanged`.
---
### 3. Invariants
- `View.DataContext` is always set to `this` (the view model instance) during construction.
- `_eventAggregator` subscriptions are established in the constructor and persist for the lifetime of the instance.
- `IsBusy` is updated synchronously in response to `BusyIndicatorChangeNotification` events.
- `NumberOf*Text` properties parse their setters as `int` without validation—invalid input will throw `FormatException`.
- `IsDirty` is read-only and never set to `true` in the current implementation.
- `NotificationRequest` is raised with a `Notification` object containing a `NotificationContentEventArgs` (with empty strings for unused fields) and the original title.
- The class is marked `[PartCreationPolicy(CreationPolicy.Shared)]`, implying a singleton lifetime within the MEF container.
---
### 4. Dependencies
#### Imports / Dependencies
- **Prism Framework**:
- `Prism.Events.IEventAggregator` (for event pub/sub)
- `Prism.Regions.IRegionManager` (for region navigation)
- `Prism.Commands.DelegateCommand` (for command binding)
- `Prism.Interactivity.InteractionRequest` (for popup notifications)
- **Unity Container**: `IUnityContainer` (dependency injection)
- **Custom Interfaces/Events**:
- `IQASettingsView` (view interface)
- `DTS.Common.Events.RaiseNotification`, `DTS.Common.Events.BusyIndicatorChangeNotification` (event types)
- `DTS.Common.Base.IBasePropertyChanged` (custom interface)
- **System Components**: `System.ComponentModel.INotifyPropertyChanged`, `System.Threading.Tasks.Task`
#### Exports / Used By
- Exported as `IQASettingsView` via `[Export(typeof(IQASettingsView))]`, implying it is consumed by a Prism region or view locator expecting that interface.
- Likely consumed by the `QASettingsView` UI (e.g., XAML view bound to this VM).
---
### 5. Gotchas
- **`async void` in `CreateMethod()`**:
The `CreateMethod()` handler is `async void`, which is generally discouraged (no way to await or handle exceptions properly). This may lead to unobserved exceptions.
- **`SetProperty` throws `NotImplementedException`**:
The `SetProperty` method (commonly used in MVVM to reduce boilerplate for property setters) is declared but unimplemented. This suggests incomplete refactoring or copy-paste from a base class.
- **No validation in property setters**:
All `NumberOf*Text` setters use `int.Parse(value)` without error handling. Invalid input (e.g., non-numeric strings) will crash the UI thread.
- **Unused `ConfirmationRequest`**:
Declared but never raised—likely leftover from design or future use.
- **`IsDirty` is always `false`**:
No logic tracks changes; this property is effectively dead code.
- **`HeaderInfo` is hardcoded**:
Returns `"MainRegion"` literally—likely a placeholder or misnamed constant.
- **`IBasePropertyChanged` interface**:
Custom interface (not `INotifyPropertyChanged`) is implemented explicitly, but its purpose is unclear from this file alone.
- **No disposal logic**:
`_eventAggregator` subscriptions are not unsubscribed in `Cleanup()`/`CleanupAsync()`—risk of memory leaks if the view model outlives its view.

View File

@@ -0,0 +1,79 @@
---
source_files:
- DataPRO/Modules/SystemSettings/RealtimeSettings/RealtimeSettingsModule.cs
generated_at: "2026-04-16T04:40:02.624732+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "178b0f618bea4bf7"
---
# RealtimeSettings
## Documentation: RealtimeSettingsModule
### 1. Purpose
The `RealtimeSettingsModule` is a Prism module responsible for bootstrapping and registering the view and view model for the Realtime Settings UI component within the application. It integrates with the Unity dependency injection container to expose `IRealtimeSettingsView` and `IRealtimeSettingsViewModel` as singleton services, enabling their later resolution and composition into the main UI. Additionally, it provides assembly-level metadata via the `RealtimeSettingsImageAttribute`, which is used by the host application (e.g., on the main screen) to display the modules name, group, and icon.
### 2. Public Interface
#### `RealtimeSettingsModule`
- **`RealtimeSettingsModule(IUnityContainer unityContainer)`**
Constructor. Accepts a Unity container via dependency injection and stores it for later use in type registration.
- **`void Initialize()`**
Registers two types as singletons in the Unity container:
- `IRealtimeSettingsView``RealtimeSettingsView`
- `IRealtimeSettingsViewModel``RealtimeSettingsViewModel`
This method is called by `RegisterTypes`, and is expected to be invoked exactly once during module initialization.
- **`void OnInitialized(IContainerProvider containerProvider)`**
Empty implementation. No post-initialization logic is defined.
- **`void RegisterTypes(IContainerRegistry containerRegistry)`**
Delegates to `Initialize()`, performing the same type registrations. Note: Although the parameter is of type `IContainerRegistry`, the method internally uses the stored `_unityContainer` (of type `IUnityContainer`) rather than `containerRegistry`. This suggests potential inconsistency with Prisms expected pattern.
#### `RealtimeSettingsImageAttribute`
- **`RealtimeSettingsImageAttribute()`**
Default constructor; initializes `_img` by calling `AssemblyInfo.GetImage(AssemblyNames.RealtimeSettings.ToString())`.
- **`RealtimeSettingsImageAttribute(string s)`**
Constructor accepting a string argument (unused); also initializes `_img` via the same `AssemblyInfo.GetImage(...)` call.
- **`override BitmapImage AssemblyImage`**
Gets the assembly image by calling `AssemblyInfo.GetImage(AssemblyNames.RealtimeSettings.ToString())`. Returns a `BitmapImage`.
- **`override string AssemblyName`**
Returns `"RealtimeSettings"` (via `AssemblyNames.RealtimeSettings.ToString()`).
- **`override string AssemblyGroup`**
Returns `"Administrative"` (via `eAssemblyGroups.Administrative.ToString()`).
- **`override eAssemblyRegion AssemblyRegion`**
Throws `NotImplementedException`.
- **`override eAssemblyRegion GetAssemblyRegion()`**
Throws `NotImplementedException`.
- **`override Type GetAttributeType()`**
Returns `typeof(ImageAttribute)`.
- **`override BitmapImage GetAssemblyImage()`**
Returns `AssemblyImage`.
- **`override string GetAssemblyName()`**
Returns `AssemblyName`.
- **`override string GetAssemblyGroup()`**
Returns `AssemblyGroup`.
### 3. Invariants
- `RealtimeSettingsModule` must be instantiated with a non-null `IUnityContainer` reference; otherwise, `Initialize()` will throw a `NullReferenceException`.
- Type registration via `Initialize()` must occur only once per module lifecycle; repeated calls (e.g., due to misordered initialization) may cause duplicate registrations or runtime errors depending on Unitys behavior.
- `AssemblyImage`, `AssemblyName`, and `AssemblyGroup` are computed at runtime via static calls to `AssemblyInfo.GetImage(...)` and string conversions of `AssemblyNames`/`eAssemblyGroups`. These values are expected to be stable and valid at assembly load time.
- `AssemblyRegion` and `GetAssemblyRegion()` are explicitly unimplemented and will always throw `NotImplementedException`. Any consumer relying on region metadata will fail at runtime.
### 4. Dependencies
**Dependencies *of* this module:**
- `DTS.Common` and `DTS.Common.Interface` (for `AssemblyInfo`, `AssemblyNames`, `eAssemblyGroups`, `ImageAttribute`, `eAssemblyRegion`)
- `Prism.Modularity` and `Prism.Ioc` (for `IModule`, `IContainerRegistry`, `IContainerProvider`)
- `Unity` (for `IUnityContainer`)
- `System.Windows.Media.Imaging` (for `BitmapImage`)
- `System.ComponentModel.Composition` (for `[Export]` and `[Module]` attributes)
**Dependencies *on* this module:**
- The host application (e.g., shell or main UI) likely consumes `RealtimeSettingsImageAttribute` via reflection on the assembly to render module metadata (name, group, image) on the main screen.
- Other modules or services may resolve `IRealtimeSettingsView` or `IRealtimeSettingsViewModel` via the Unity container after `RealtimeSettingsModule.Initialize()` has run.
### 5. Gotchas
- **`RegisterTypes` ignores its parameter**: Although `RegisterTypes` receives an `IContainerRegistry`, it calls `Initialize()`, which uses the private `_unityContainer` (`IUnityContainer`). This violates Prisms intended pattern (where `IContainerRegistry` should be used for registration) and may cause issues if the module is used in a non-Unity Prism environment or if container resolution is decoupled.
- **Unimplemented region metadata**: `AssemblyRegion` and `GetAssemblyRegion()` throw `NotImplementedException`. Any UI or tooling expecting region data will crash.
- **Redundant constructor overloads**: The `RealtimeSettingsImageAttribute(string s)` constructor accepts a parameter that is never used. This may be legacy or placeholder code.
- **No error handling in image loading**: If `AssemblyInfo.GetImage(...)` fails (e.g., missing image resource), the exception propagates during attribute instantiation or property access, potentially causing assembly load failures.
- **Assumes singleton registration**: The module registers views/viewmodels as singletons, but no documentation clarifies whether this is intentional (e.g., shared state) or accidental (e.g., should be transient/scoped).

View File

@@ -0,0 +1,48 @@
---
source_files:
- DataPRO/Modules/SystemSettings/RealtimeSettings/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T04:42:54.865293+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "3833939a0a078d0f"
---
# Properties
### **1. Purpose**
This module (`DataPRO.Modules.SystemSettings.RealtimeSettings`) is an assembly containing metadata and configuration attributes for a .NET component related to real-time system settings within the broader DataPRO platform. Its primary purpose is to define assembly-level metadata (such as title, version, and COM visibility) rather than implement business logic. It serves as a foundational infrastructure component, likely referenced by other modules that consume or manage real-time configuration data.
---
### **2. Public Interface**
This file contains **no public types, functions, classes, or methods**. It is an `AssemblyInfo.cs` file that exclusively defines assembly-level attributes via attributes applied to the assembly itself (e.g., `AssemblyTitle`, `AssemblyVersion`). There are no executable or declarable public APIs exposed by this module.
---
### **3. Invariants**
- The assembly is **not visible to COM** (`ComVisible(false)`), meaning it is not intended for interop with COM clients.
- The assembly version is fixed at `1.0.0.0` for both `AssemblyVersion` and `AssemblyFileVersion`.
- The GUID `7446722e-490d-4f6a-beaf-907947e576d5` is permanently assigned as the typelib ID (used only if COM visibility were enabled).
- All assembly attributes are static and immutable at runtime.
---
### **4. Dependencies**
- **Depends on**:
- `System.Reflection`
- `System.Runtime.CompilerServices`
- `System.Runtime.InteropServices`
These are standard .NET framework namespaces for reflection, runtime compilation, and COM interop support.
- **Depended on by**:
- Unknown from this file alone. As an `AssemblyInfo.cs`, this module does not directly depend on or get consumed by other modules in a functional sense. However, other modules in the `DataPRO` solution likely reference this assembly (e.g., `DataPRO.Modules.SystemSettings`) to access its types or metadata.
---
### **5. Gotchas**
- **No runtime logic**: Developers should not expect any executable code or stateful behavior from this module. Misinterpreting it as a functional module may lead to confusion about where real-time settings logic resides.
- **Versioning rigidity**: Both `AssemblyVersion` and `AssemblyFileVersion` are hardcoded to `1.0.0.0`, which may indicate legacy status or a need for CI/CD integration to auto-increment versions.
- **COM support disabled**: If future integration with COM-based tools is required, `ComVisible(true)` and a stable typelib GUID must be explicitly configured—this is currently not the case.
- **Missing documentation**: `AssemblyDescription` and `AssemblyCompany` are empty strings, suggesting incomplete metadata or reliance on external documentation.
None identified beyond the above.

View File

@@ -0,0 +1,100 @@
---
source_files:
- DataPRO/Modules/SystemSettings/RealtimeSettings/Resources/TranslateExtension.cs
- DataPRO/Modules/SystemSettings/RealtimeSettings/Resources/StringResources.Designer.cs
generated_at: "2026-04-16T04:42:50.978478+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "2a6f478ba4a248f4"
---
# Resources
## Documentation: `TranslateExtension` and `StringResources`
---
### 1. **Purpose**
This module provides localized string support for the `RealtimeSettings` UI layer in a WPF application. It consists of two tightly coupled components:
- `TranslateExtension`, a XAML markup extension enabling declarative localization in XAML (e.g., `{local:Translate KeyName}`), and
- `StringResources`, a strongly-typed, auto-generated resource class that wraps access to embedded string resources (`.resx`-backed).
Together, they allow UI elements to display culture-sensitive text without hardcoding strings, supporting runtime language switching via `StringResources.Culture`.
---
### 2. **Public Interface**
#### `TranslateExtension` class
- **Namespace**: `RealtimeSettings.Resources`
- **Base class**: `System.Windows.Markup.MarkupExtension`
- **Attributes**: `[MarkupExtensionReturnType(typeof(string))]`
| Member | Signature | Behavior |
|--------|-----------|----------|
| **Constructor** | `public TranslateExtension(string key)` | Stores the resource key (`_key`) for later lookup. Does not validate key format or existence. |
| **ProvideValue** | `public override object ProvideValue(IServiceProvider serviceProvider)` | Returns the localized string for `_key` using `StringResources.ResourceManager.GetString(_key)`. If `_key` is `null`/empty or lookup fails, returns a fallback string (see *Invariants*). |
#### `StringResources` class
- **Namespace**: `RealtimeSettings.Resources`
- **Attributes**: `[GeneratedCode]`, `[DebuggerNonUserCode]`, `[CompilerGenerated]`
- **Visibility**: `internal` (not public)
| Member | Signature | Behavior |
|--------|-----------|----------|
| **ResourceManager** | `internal static ResourceManager ResourceManager { get; }` | Lazily initializes and returns a `ResourceManager` for the `RealtimeSettings.Resources.StringResources` resource file (embedded in the assembly). |
| **Culture** | `internal static CultureInfo Culture { get; set; }` | Gets/sets the UI culture used for resource lookups. Affects all subsequent `GetString` calls. |
| **Static properties** | e.g., `internal static string DelayBetweenPolls { get; }` | Each property performs a `ResourceManager.GetString("KeyName")` call. Property names match resource keys (e.g., `"DelayBetweenPolls"`). |
**Notable string keys defined in `StringResources`**:
- `DelayBetweenPolls`, `DelayBetweenPollsHelp`
- `HighDelay`, `HighDelayHelp`
- `LowDelay`, `LowDelayHelp`
- `RealtimeSampleRate`, `RealtimeSampleRates`, `RealtimeSampleRateSliceIP`, `RealtimeSampleRateSliceUSB`, `RealtimeSampleRateTDASG5`
- `SampleRate`, `SampleRateHelp`
- `UseMeterModeHelp`, `UseMeterModeTableStyle`
---
### 3. **Invariants**
- **Key validation**:
- If `_key` passed to `TranslateExtension` is `null` or empty (`""`), `ProvideValue` returns `"#stringnotfound#"`.
- If `StringResources.ResourceManager.GetString(_key)` returns `null` (key not found), `ProvideValue` returns `"#stringnotfound# " + _key` (e.g., `"#stringnotfound# MissingKey"`).
- **Resource key consistency**:
- `StringResources` properties are generated from keys in the `.resx` file. The key used in `TranslateExtension(key)` must exactly match the resource name (e.g., `"DelayBetweenPolls"`), including case.
- **Thread-safety**:
- `StringResources.ResourceManager` is thread-safe (uses `Lazy<T>`-like pattern via `ReferenceEquals` check).
- `StringResources.Culture` is *not* thread-safe; concurrent writes may cause race conditions.
- **Fallback behavior**:
- No exception is thrown for missing keys—only fallback strings. This avoids runtime crashes but may result in visible placeholder text.
---
### 4. **Dependencies**
#### **Depends on**
- `System.Windows.Markup` (for `MarkupExtension` base class)
- `System.Resources` (via `ResourceManager`)
- `System.Globalization` (for `CultureInfo`)
- `System.CodeDom.Compiler`, `System.Diagnostics`, `System.Runtime.CompilerServices` (auto-generated attributes)
- **Embedded resource**: `RealtimeSettings.Resources.StringResources.resources` (compiled from `StringResources.resx`)
#### **Depended on by**
- **WPF XAML files** in the `RealtimeSettings` module (e.g., `*.xaml` pages) using `{local:Translate KeyName}` syntax.
- **UI code-behind** may directly access `StringResources` properties (e.g., `StringResources.DelayBetweenPolls`) for non-XAML localization.
- **No other modules** appear to depend on this (based on namespace isolation: `RealtimeSettings.Resources`).
---
### 5. **Gotchas**
- **Hardcoded fallback prefix**: The `"#stringnotfound#"` prefix is hardcoded in `TranslateExtension`—not configurable or localized itself.
- **No null-safety for `serviceProvider`**: `ProvideValue` does not validate `serviceProvider` (though WPF always provides one during XAML parsing).
- **Case sensitivity**: Resource keys are case-sensitive. A typo like `"delaybetweenpolls"` (lowercase) will fail lookup.
- **Designer file warnings**: `StringResources.Designer.cs` explicitly warns that manual changes are lost on regeneration. Modifying `.resx` requires rebuilding to sync `StringResources`.
- **Culture persistence**: `StringResources.Culture` only affects *new* lookups; existing `TranslateExtension` instances retain the culture at instantiation time (since `ProvideValue` is called at XAML parse time).
- **No support for pluralization/formatting**: `TranslateExtension` only returns raw strings. Placeholders (e.g., `{0}`) are possible in `.resx` but must be manually handled in XAML (e.g., `String.Format` in code-behind).
- **No localization for non-string resources**: Only strings are supported; no support for images, icons, etc.
None identified beyond these.

View File

@@ -0,0 +1,33 @@
---
source_files:
- DataPRO/Modules/SystemSettings/RealtimeSettings/View/RealtimeSettingsView.xaml.cs
generated_at: "2026-04-16T04:42:57.437879+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "b34a084e20af6733"
---
# View
1. **Purpose**
This module defines the WPF view class `RealtimeSettingsView`, which serves as the UI layer for the real-time settings feature. It implements the `IRealtimeSettingsView` interface (from `DTS.Common.Interface`) and is responsible for rendering the user interface defined in `RealtimeSettingsView.xaml`. Its role is to provide a concrete implementation of the view contract, enabling dependency injection and separation of concerns in the MVVM (Model-View-ViewModel) architecture used by the system.
2. **Public Interface**
- `RealtimeSettingsView()`
Public parameterless constructor. Calls `InitializeComponent()` to instantiate and wire up UI elements defined in `RealtimeSettingsView.xaml`. No additional initialization logic is present in the provided source.
3. **Invariants**
- The class must be instantiated on the UI thread (as it is a WPF `UserControl`-derived type, implicitly via `InitializeComponent()`), though the base type is not explicitly shown, standard WPF conventions apply.
- `InitializeComponent()` must be called exactly once during construction; calling it again may cause runtime exceptions (e.g., duplicate names in XAML).
- The class implements `IRealtimeSettingsView`, so it must conform to that interfaces contract (though the interface definition is external and not provided here).
4. **Dependencies**
- **External dependency**: `DTS.Common.Interface.IRealtimeSettingsView` — the interface this view implements; its definition is in an external assembly (`DTS.Common.Interface.dll` or similar).
- **Internal dependency**: `RealtimeSettingsView.xaml` — the XAML file defining the visual structure; `InitializeComponent()` is auto-generated from this file.
- **Inferred usage**: This view is likely consumed by a ViewModel or controller that depends on `IRealtimeSettingsView`, enabling testability and decoupling.
5. **Gotchas**
- The constructor contains no additional logic beyond `InitializeComponent()`. Any initialization requiring data binding or ViewModel setup must occur in the ViewModel or via code-behind hooks (e.g., `Loaded` event), not here.
- No error handling or validation is present in the constructor; failures in `InitializeComponent()` (e.g., malformed XAML) will result in runtime exceptions during view instantiation.
- The class is `partial`, implying the remainder of the implementation resides in the auto-generated `RealtimeSettingsView.g.i.cs` file (not provided), which contains the `InitializeComponent()` method and field declarations for named XAML elements.
- None identified from source alone.

View File

@@ -0,0 +1,136 @@
---
source_files:
- DataPRO/Modules/SystemSettings/RealtimeSettings/ViewModel/RealtimeSettingsViewModel.cs
generated_at: "2026-04-16T04:42:47.252875+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "2371d547d8ea5652"
---
# ViewModel
## Documentation: `RealtimeSettingsViewModel`
---
### **1. Purpose**
The `RealtimeSettingsViewModel` class serves as the view model for the Realtime Settings UI module within the application. It implements the `IRealtimeSettingsViewModel` interface and is exported as an `IRealtimeSettingsView` using MEF, enabling Prism-based MVVM integration. Its primary responsibilities include managing UI state for real-time configuration settings (e.g., sample rate, delay), handling interaction requests for notifications and confirmations, and responding to global events—specifically `RaiseNotification` and `BusyIndicatorChangeNotification`. It acts as a bridge between the view (`IRealtimeSettingsView`) and underlying system events, without containing business logic itself.
---
### **2. Public Interface**
#### **Constructor**
```csharp
public RealtimeSettingsViewModel(
IRealtimeSettingsView view,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
```
- Initializes the view model, sets up the view context, registers event subscriptions, and initializes interaction requests.
#### **Methods**
- `void Cleanup()`
No-op stub; intended for cleanup logic but currently does nothing.
- `Task CleanupAsync()`
Returns `Task.CompletedTask`; no-op async stub.
- `void Initialize()`
No-op stub.
- `void Initialize(object parameter)`
No-op stub.
- `void Initialize(object parameter, object model)`
No-op stub.
- `Task InitializeAsync()`
Returns `Task.CompletedTask`; no-op async stub.
- `Task InitializeAsync(object parameter)`
Returns `Task.CompletedTask`; no-op async stub.
- `void Activated()`
No-op stub; likely part of Prisms `INavigationAware` or region lifecycle, but unimplemented.
#### **Properties**
- `IRealtimeSettingsView View { get; }`
Reference to the associated view instance.
- `InteractionRequest<Notification> NotificationRequest { get; }`
Prism interaction request used to trigger notification popups.
- `InteractionRequest<Confirmation> ConfirmationRequest { get; }`
Prism interaction request used to trigger confirmation dialogs.
- `string RealtimeSampleRate { get; set; }`
Binds to the currently selected sample rate string (e.g., `"48 kHz"`). Triggers property change notification.
- `string RealtimeSampleRates { get; set; }`
Binds to a list or set of available sample rates (e.g., `"44.1 kHz, 48 kHz"`). On change, also raises `OnPropertyChanged("RealtimeSampleRate")`.
- `string RealtimeDelayText { get; set; }`
Binds to the delay value display text (e.g., `"12.5 ms"`).
- `bool IsDirty { get; }`
Read-only flag indicating whether the view model state has unsaved changes. Currently always `false`; no logic to update it.
- `bool IsBusy { get; set; }`
Controls busy indicator visibility. Set via `OnBusyIndicatorNotification(bool)` event handler.
- `bool IsMenuIncluded { get; set; }`
Controls whether the menu is visible in the view.
- `bool IsNavigationIncluded { get; set; }`
Controls whether navigation controls are visible in the view.
- `string HeaderInfo { get; }`
Returns the constant `"MainRegion"`; likely used for region naming or header labeling.
---
### **3. Invariants**
- `View.DataContext` is always set to `this` during construction.
- `_eventAggregator` subscriptions are established in the constructor and never unsubscribed (potential memory leak risk).
- `RealtimeSampleRates` setter *always* triggers `OnPropertyChanged("RealtimeSampleRate")`, implying that `RealtimeSampleRate` is derived or dependent on `RealtimeSampleRates`.
- `IsDirty` is declared but never updated—its value is *always* `false`.
- `IsBusy` is updated *only* via the `OnBusyIndicatorNotification(bool)` handler, which is subscribed to `BusyIndicatorChangeNotification`.
- `NotificationRequest` is raised *only* via `OnRaiseNotification(NotificationContentEventArgs)`, which wraps the incoming `eventArgsWithTitle` into a `Notification` object with a `NotificationContentEventArgs` (with empty title and footer fields) and a `Title` taken from the event args.
---
### **4. Dependencies**
#### **Imports / Dependencies**
- **MEF**: `[Export(typeof(IRealtimeSettingsView))]` and `[PartCreationPolicy(CreationPolicy.Shared)]` indicate this class is a shared MEF component.
- **Prism**: Uses `IEventAggregator`, `IRegionManager`, `InteractionRequest<T>`, and likely `INavigationAware` (via `Activated()`).
- **Unity**: `IUnityContainer` is injected for dependency resolution.
- **Custom Types**:
- `IRealtimeSettingsView` (view interface)
- `BasePropertyChanged` (base class for `INotifyPropertyChanged`)
- `RaiseNotification`, `BusyIndicatorChangeNotification` (event types from `DTS.Common.Events`)
- `NotificationContentEventArgs`, `Notification`, `NotificationContentEventArgsWithoutTitle` (from `DTS.Common.Interactivity`)
- `NotificationWindow`, `PopupWindowAction` (referenced in comments, likely in `DTS.Common.Interface` or `.Infrastructure`)
#### **Depended Upon**
- The module is exported as `IRealtimeSettingsView`, so it is consumed by the shell or region manager when the `RealtimeSettings` view is requested.
---
### **5. Gotchas**
- **No-op lifecycle methods**: `Initialize()`, `InitializeAsync()`, `Activated()`, `Cleanup()`, and `CleanupAsync()` are all empty stubs. Any initialization or cleanup logic must be added manually—no behavior is implemented.
- **`IsDirty` is never set**: The property exists but is never updated; it remains `false` for the lifetime of the object. If dirty tracking is required, this must be implemented.
- **Event subscriptions are never unsubscribed**: `_eventAggregator.GetEvent<...>().Subscribe(...)` calls lack `Unsubscribe()` calls, which may cause memory leaks or unexpected behavior if the view model is disposed but events continue firing.
- **`RealtimeSampleRates` setter triggers `RealtimeSampleRate` change**: This implies `RealtimeSampleRate` is *logically* derived from `RealtimeSampleRates`, but no parsing or validation is done in the setter. Consumers must ensure `RealtimeSampleRate` is a valid value from `RealtimeSampleRates`.
- **`NotificationContentEventArgs` constructor usage is non-obvious**: The `OnRaiseNotification` method constructs a new `NotificationContentEventArgs(...)` with empty strings for title and footer, then wraps it in a `Notification` object. This suggests a mismatch between event payload structure and popup expectation—potential source of confusion or UI misrendering.
- **No validation on sample rate/delay fields**: `RealtimeSampleRate` and `RealtimeDelayText` are plain strings with no validation or formatting logic in the view model.
- **Comments reference outdated/incorrect types**: The `OnRaiseNotification` comment mentions `NotificationContentEventArgsWithoutTitle`, but the code instantiates `NotificationContentEventArgs` directly. This may indicate legacy or incomplete documentation.
---
*No additional behavior is evident from the source beyond what is described.*

View File

@@ -0,0 +1,96 @@
---
source_files:
- DataPRO/Modules/SystemSettings/Tables/TablesSettingsModule.cs
generated_at: "2026-04-16T04:39:15.502612+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "6c60f7444292529a"
---
# Tables
## Documentation: TablesSettingsModule
### 1. Purpose
The `TablesSettingsModule` is a Prism module responsible for registering the view and view model for the *Tables Settings* UI component within the applications modular architecture. It integrates with the Unity dependency injection container to enable inversion of control (IoC) and lifecycle management for the `TablesSettingsView` and `TablesSettingsViewModel`. This module enables the Tables Settings feature to be discovered, loaded, and rendered as part of the main application shell—specifically under the *Administrative* section—as indicated by its associated metadata attribute.
### 2. Public Interface
#### `TablesSettingsModule` class
- **`TablesSettingsModule(IUnityContainer unityContainer)`**
Constructor that receives the Unity container via dependency injection. Stores the container for later use in type registration.
- **`void Initialize()`**
Registers two types as singletons in the Unity container:
- `ITablesSettingsView``TablesSettingsView`
- `ITablesSettingsViewModel``TablesSettingsViewModel`
This method is called both directly during module initialization and indirectly via `RegisterTypes`.
- **`void OnInitialized(IContainerProvider containerProvider)`**
Currently empty; no initialization logic is performed here.
- **`void RegisterTypes(IContainerRegistry containerRegistry)`**
Delegates to `Initialize()`, performing the same type registrations. This is part of the Prism `IModule` interface contract.
#### `TablesSettingsImageAttribute` class
- **`TablesSettingsImageAttribute()`**
Default constructor; delegates to the parameterized constructor with `null`.
- **`TablesSettingsImageAttribute(string s)`**
Constructor accepting a string argument (unused), initializes `_img` by calling `AssemblyInfo.GetImage(AssemblyNames.TablesSettings.ToString())`.
- **`override eAssemblyRegion AssemblyRegion`**
Property that *always throws `NotImplementedException`*.
- **`override BitmapImage AssemblyImage`**
Property that returns the assembly image for *TablesSettings*, retrieved via `AssemblyInfo.GetImage(...)`. Caches the result in `_img`.
- **`override Type GetAttributeType()`**
Returns `typeof(ImageAttribute)`.
- **`override BitmapImage GetAssemblyImage()`**
Returns the value of the `AssemblyImage` property.
- **`override string AssemblyName`**
Property that returns `"TablesSettings"` (via `AssemblyNames.TablesSettings.ToString()`). Caches in `_name`.
- **`override string GetAssemblyName()`**
Returns the value of the `AssemblyName` property.
- **`override eAssemblyRegion GetAssemblyRegion()`**
Method that *always throws `NotImplementedException`*.
- **`override string AssemblyGroup`**
Property that returns `"Administrative"` (via `eAssemblyGroups.Administrative.ToString()`). Caches in `_group`.
- **`override string GetAssemblyGroup()`**
Returns the value of the `AssemblyGroup` property.
> **Note**: The `TablesSettingsImageAttribute` inherits from `ImageAttribute` (not shown in source), and is applied at the assembly level via `[assembly: TablesSettingsImage]` (not visible in this file but implied by its usage context).
### 3. Invariants
- The `TablesSettingsModule` must be loaded *before* any consumer attempts to resolve `ITablesSettingsView` or `ITablesSettingsViewModel`, since registration occurs in `Initialize()`/`RegisterTypes()`.
- The `AssemblyImage` and `AssemblyName` properties are *idempotent* (cached after first access), but rely on `AssemblyInfo.GetImage(...)` and `AssemblyNames.TablesSettings.ToString()` returning consistent values.
- The `AssemblyGroup` is *always* `"Administrative"` (hardcoded).
- The `AssemblyRegion` and `GetAssemblyRegion()` methods are *unimplemented* and will throw `NotImplementedException` if invoked.
### 4. Dependencies
**Depends on (imports/uses):**
- `System.ComponentModel.Composition` (`[Export]`, `[Module]`)
- `DTS.Common` (specifically `AssemblyInfo`, `AssemblyNames`, `eAssemblyGroups`)
- `Prism.Modularity` (`IModule`, `IContainerRegistry`)
- `Prism.Ioc` (`IContainerProvider`)
- `Unity` (`IUnityContainer`)
- `System.Windows.Media.Imaging` (`BitmapImage`)
**Used by (consumers):**
- The Prism module loading infrastructure (via `[Export(typeof(IModule))]` and `[Module(ModuleName = "TablesSettings")]`).
- The application shell or UI framework (via `TablesSettingsImageAttribute` applied at assembly level) to display the modules icon and group on the main screen.
### 5. Gotchas
- **`AssemblyRegion` and `GetAssemblyRegion()` are unimplemented** — any code attempting to use them (e.g., for region-based routing or grouping logic) will crash with `NotImplementedException`.
- The `TablesSettingsImageAttribute(string)` constructor accepts a parameter `s` that is *ignored* — likely legacy or placeholder.
- `Initialize()` is called twice: once directly in `RegisterTypes()` and potentially again if Prism calls `Initialize()` explicitly (though Prisms `IModule` lifecycle typically calls `RegisterTypes()` first, then `Initialize()`). This is safe here because Unitys `RegisterType<T, TImpl>()` is idempotent for singleton registrations, but could be confusing.
- The module assumes `AssemblyInfo.GetImage(AssemblyNames.TablesSettings.ToString())` returns a valid `BitmapImage`; failure to load the image (e.g., missing resource) may cause silent failures or runtime exceptions depending on `AssemblyInfo`s implementation.
- No error handling or logging is present in `Initialize()` — registration failures (e.g., due to missing view/viewmodel types) will surface later as resolution errors.
- **No public API beyond module registration and metadata** — this module does not expose domain logic or services beyond its view/viewmodel pair.

View File

@@ -0,0 +1,42 @@
---
source_files:
- DataPRO/Modules/SystemSettings/Tables/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T04:40:17.665123+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "519f228272482faa"
---
# Properties
## 1. Purpose
This module is an assembly-level metadata configuration file (`AssemblyInfo.cs`) for the `TablesSettings` component within the `DataPRO/Modules/SystemSettings/Tables/Properties/` directory. Its purpose is to define standard .NET assembly attributes—such as title, version, and COM visibility—used for identification, versioning, and interop integration. It does not contain executable logic or business functionality; it serves as a declarative metadata layer for the compiled assembly.
## 2. Public Interface
This file contains **no public types, functions, classes, or methods**. It only declares assembly-level attributes via `System.Reflection` and `System.Runtime.InteropServices` attributes. Therefore, there is no public API surface to document.
## 3. Invariants
- The assembly is **not visible to COM** (`ComVisible(false)`), meaning it cannot be consumed by COM clients unless explicitly overridden per type (not done here).
- The assembly version is fixed at `1.0.0.0` for both `AssemblyVersion` and `AssemblyFileVersion`.
- The `Guid` attribute is set to `"7446722e-490d-4f6a-beaf-907947e576d5"` for the typelib ID (used only if `ComVisible(true)` were enabled).
- No culture-specific settings are defined (`AssemblyCulture("")` indicates a neutral/culture-agnostic assembly).
- The `AssemblyTitle` and `AssemblyProduct` are both `"TablesSettings"`; `AssemblyCopyright` is `"Copyright © 2016"`.
## 4. Dependencies
- **Dependencies**:
- `System.Reflection`
- `System.Runtime.CompilerServices`
- `System.Runtime.InteropServices`
These are standard .NET runtime namespaces; no external or project-specific dependencies are declared in this file.
- **Depended upon by**:
- The build system (e.g., MSBuild) uses these attributes to generate assembly metadata in the compiled `.dll`.
- Tools that inspect assembly metadata (e.g., reflection-based tools, COM registration utilities) will read these values.
- Other modules in the `DataPRO` system may reference this assembly and rely on its identity/version for compatibility checks, though no such usage is evident from this file alone.
## 5. Gotchas
- **Versioning rigidity**: Both `AssemblyVersion` and `AssemblyFileVersion` are hardcoded to `1.0.0.0`. This may cause issues with binding redirects, side-by-side deployment, or version-based feature detection if the assembly is updated without incrementing these values.
- **COM incompatibility**: With `ComVisible(false)`, this assembly cannot be consumed by legacy COM clients. If COM interop is required, this setting must be changed *and* types must be explicitly marked `[ComVisible(true)]`, but this is not currently supported.
- **Missing strong name**: No `AssemblyKeyFile` or `AssemblyKeyName` is specified, implying the assembly is not strong-named. This may affect deployment scenarios requiring strong-named assemblies (e.g., GAC installation).
- **Copyright year**: The `AssemblyCopyright` year is `2016`, which may be outdated if the assembly has been modified since then.
- **No documentation**: `AssemblyDescription` and `AssemblyTrademark` are empty strings, offering no human-readable context beyond the title/product name.
- *None identified from source alone.* beyond the above—no behavioral logic or hidden side effects exist in this metadata-only file.

View File

@@ -0,0 +1,35 @@
---
source_files:
- DataPRO/Modules/SystemSettings/Tables/View/TablesSettingsView.xaml.cs
generated_at: "2026-04-16T04:40:25.476767+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "19a5ade10e72dc4e"
---
# View
### 1. **Purpose**
This module provides the WPF view implementation for the system settings UI related to table configurations. Specifically, `TablesSettingsView` serves as the visual layer (XAML-backed UI control) that presents and potentially interacts with table-related settings, conforming to the `ITablesSettingsView` interface defined in the `DTS.Common.Interface` namespace. Its role is to decouple UI presentation logic from business logic, enabling testability and separation of concerns within the applications settings module.
### 2. **Public Interface**
- **`TablesSettingsView()`**
*Signature:* `public TablesSettingsView()`
*Behavior:* Constructor that initializes the WPF component by calling `InitializeComponent()`, which wires up the XAML-defined UI elements (defined in `TablesSettingsView.xaml`) to the code-behind. No additional initialization logic is present in the provided source.
### 3. **Invariants**
- The class implements the `ITablesSettingsView` interface (as indicated by `public partial class TablesSettingsView : ITablesSettingsView`), so all members required by that interface must be implemented elsewhere (e.g., in a partial class file or via explicit interface implementation in the same file—though not visible in this snippet).
- `InitializeComponent()` must be called exactly once during construction; this is standard for WPF user controls and is enforced by the constructor.
- No validation, state mutation, or business logic is present in this file; the class is a pure UI container at this level.
### 4. **Dependencies**
- **External dependency:** `DTS.Common.Interface` — provides the `ITablesSettingsView` interface contract.
- **WPF framework dependencies:** Implicit reliance on `System.Windows` (via `InitializeComponent()` and XAML compilation), though not explicitly imported.
- **Internal dependency (inferred):** `TablesSettingsView.xaml` — the corresponding XAML file must exist and define the UI layout; otherwise, `InitializeComponent()` will fail at runtime.
- *Depended upon by:* Any consumer of `ITablesSettingsView`, likely a view model or settings controller that instantiates or binds to `TablesSettingsView`.
### 5. **Gotchas**
- The source file contains no logic beyond the constructor and base WPF initialization, so critical behavior (e.g., event handling, data binding setup, or interface implementation details) resides elsewhere (e.g., in `TablesSettingsView.xaml.cs` partial extensions not shown, or in `TablesSettingsView.xaml`).
- The interface `ITablesSettingsView` is referenced but not defined here; its contract (methods, properties, events) is unknown from this file alone and must be consulted separately.
- No error handling or null checks are present in the constructor—reliance on WPFs `InitializeComponent()` behavior (which throws if XAML fails to load) is implicit.
- **No identified business logic or side effects**, but absence of code does not guarantee absence of hidden complexity (e.g., XAML may contain triggers, converters, or bindings with non-trivial dependencies).

View File

@@ -0,0 +1,116 @@
---
source_files:
- DataPRO/Modules/SystemSettings/Tables/ViewModel/TablesSettingsViewModel.cs
generated_at: "2026-04-16T04:40:21.830816+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "d6165d55cd0ea9cd"
---
# ViewModel
## Documentation: `TablesSettingsViewModel`
---
### 1. **Purpose**
`TablesSettingsViewModel` is the view model for the *Tables Settings* module within the applications UI layer. It acts as the data context for `ITablesSettingsView`, coordinating UI state (e.g., busy status, menu/navigation visibility) and bridging communication between the view and the applications event infrastructure via `IEventAggregator`. It also exposes `InteractionRequest`s to support modal notifications and confirmations through Prisms interaction patterns. This module is part of a modular, MEF-exported component system and is intended to be shared across the application lifecycle.
---
### 2. **Public Interface**
#### **Class: `TablesSettingsViewModel`**
- **Exported as:** `[Export(typeof(ITablesSettingsView))]` — implies it is intended to be resolved as an `ITablesSettingsView` (likely via MEF or Unity).
- **Creation Policy:** `Shared` — only one instance exists per application lifetime.
##### **Properties**
| Property | Type | Description |
|---------|------|-------------|
| `View` | `ITablesSettingsView` | Reference to the associated view; set in constructor. |
| `NotificationRequest` | `InteractionRequest<Notification>` | Used to trigger display of notification popups (e.g., informational messages). |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Used to trigger confirmation dialogs. |
| `IsDirty` | `bool` | Read-only; currently always `false` (no logic implemented to set it). |
| `IsBusy` | `bool` | Gets/sets busy state; raises `PropertyChanged` on change. |
| `IsMenuIncluded` | `bool` | Gets/sets whether the menu is included in the view; raises `PropertyChanged`. |
| `IsNavigationIncluded` | `bool` | Gets/sets whether navigation is included in the view; raises `PropertyChanged`. |
| `HeaderInfo` | `string` | Read-only; always returns `"MainRegion"`. |
##### **Methods**
| Method | Signature | Description |
|--------|-----------|-------------|
| `Cleanup` | `void Cleanup()` | No-op stub. |
| `CleanupAsync` | `Task CleanupAsync()` | Returns `Task.CompletedTask`. |
| `Initialize` | `void Initialize()` | No-op stub. |
| `Initialize` | `void Initialize(object parameter)` | No-op stub. |
| `Initialize` | `void Initialize(object parameter, object model)` | No-op stub. |
| `InitializeAsync` | `Task InitializeAsync()` | Returns `Task.CompletedTask`. |
| `InitializeAsync` | `Task InitializeAsync(object parameter)` | Returns `Task.CompletedTask`. |
| `Activated` | `void Activated()` | No-op stub. |
##### **Event Handlers (Private)**
| Method | Signature | Description |
|--------|-----------|-------------|
| `OnBusyIndicatorNotification` | `private void OnBusyIndicatorNotification(bool eventArg)` | Sets `IsBusy` to `eventArg`. |
| `OnRaiseNotification` | `private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)` | Transforms `NotificationContentEventArgs` (with title/message/image) into a `Notification` object and raises `NotificationRequest`. Note: it discards the `Title` and `Image` fields of the original event args and passes them via `NotificationContentEventArgs` constructor with empty strings for some parameters — see *Gotchas*. |
##### **Interface Implementations**
| Interface | Method | Signature | Description |
|-----------|--------|-----------|-------------|
| `INotifyPropertyChanged` | `PropertyChanged` | `event PropertyChangedEventHandler PropertyChanged` | Raised via `OnPropertyChanged`. |
| `IBasePropertyChanged` | `OnPropertyChanged` | `void IBasePropertyChanged.OnPropertyChanged(string propertyName)` | Delegates to `OnPropertyChanged(propertyName)`. |
| — | `SetProperty` | `bool SetProperty<T>(ref T storage, T value, string propertyName = null)` | **Throws `NotImplementedException`** — not implemented. |
---
### 3. **Invariants**
- `View.DataContext` is always set to `this` (the view model) in the constructor.
- `IsBusy` is initialized to `false` and only modified via `OnBusyIndicatorNotification`, which is subscribed to `BusyIndicatorChangeNotification`.
- `NotificationRequest` and `ConfirmationRequest` are initialized in the constructor and never reassigned.
- `HeaderInfo` is a constant string `"MainRegion"` and never changes.
- `IsDirty` is declared but never set — its value remains `false` for the lifetime of the instance.
- `SetProperty` is declared but unimplemented — calling it will always throw `NotImplementedException`.
---
### 4. **Dependencies**
#### **Imports / Dependencies (via constructor parameters and `using` directives)**
- **Prism Libraries**:
- `IEventAggregator` — for pub/sub event handling.
- `IRegionManager` — for region navigation (though unused in current implementation).
- `Unity` container (`IUnityContainer`) — for dependency injection.
- **Custom Infrastructure**:
- `DTS.Common.Events.RaiseNotification` — event type subscribed to in constructor.
- `DTS.Common.Events.BusyIndicatorChangeNotification` — event type subscribed to in constructor.
- `DTS.Common.Base.IBasePropertyChanged` — interface implemented explicitly.
- `DTS.Common.Interface.ITablesSettingsView` — view interface.
- **MEF**:
- `[Export(typeof(ITablesSettingsView))]` — indicates this type is registered as an export for `ITablesSettingsView`.
- **UI Framework**:
- `Prism.Regions`, `Prism.Events`, `Prism.Interactivity` — used for region management, event aggregation, and interaction requests.
#### **Depended Upon By**
- The view (`ITablesSettingsView`) — this view model is bound to its `DataContext`.
- Likely consumed via MEF/Unity resolution as `ITablesSettingsView`.
- Other modules may publish `RaiseNotification` or `BusyIndicatorChangeNotification` events to trigger UI feedback via this view model.
---
### 5. **Gotchas**
- **`SetProperty` is unimplemented** — throws `NotImplementedException`. This breaks expected MVVM patterns (e.g., `INotifyPropertyChanged` helpers). Developers should avoid calling it.
- **`NotificationContentEventArgs` transformation in `OnRaiseNotification` is lossy**:
The method constructs a new `NotificationContentEventArgs` with empty strings for the 2nd and 4th parameters (likely `OkContent` and `CancelContent`), discarding any original values. This may cause unexpected behavior if callers expect those fields to be preserved.
- **No-op lifecycle methods**: `Initialize`, `InitializeAsync`, `Activated`, `Cleanup`, and `CleanupAsync` contain no logic — may indicate incomplete implementation or deferred functionality.
- **`IsDirty` is never set**: Despite being a public property, it is never assigned — always `false`. This may mislead consumers expecting dirty-state tracking.
- **`HeaderInfo` is hardcoded**: Always returns `"MainRegion"` — no dynamic behavior or configuration.
- **`IBasePropertyChanged.OnPropertyChanged` is implemented explicitly** — only callable via interface cast.
- **Thread context for `BusyIndicatorChangeNotification`**: Subscribed with `ThreadOption.PublisherThread`, meaning the handler runs on the publishers thread — may require dispatcher marshaling if the publisher is not on the UI thread (though `IsBusy` setter calls `OnPropertyChanged`, which *should* marshal to UI thread if `INotifyPropertyChanged` is handled by Prisms binding system).
---
*Documentation generated from source file `TablesSettingsViewModel.cs` only. No external behavior or assumptions beyond what is visible in the source.*

View File

@@ -0,0 +1,113 @@
---
source_files:
- DataPRO/Modules/SystemSettings/TestSettings/TestSettingsModule.cs
generated_at: "2026-04-16T04:40:08.753716+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "30e4791dc9f8aa59"
---
# TestSettings
## Documentation: `TestSettingsModule` and `TestSettingsImageAttribute`
---
### 1. **Purpose**
This module (`TestSettingsModule`) is a Prism modularity module responsible for registering the *Test Settings* UI component (View and ViewModel) into the Unity dependency injection container as singletons, enabling its later resolution and use within the application. It is part of the `TestSettings` assembly and integrates with the larger Prism-based application shell. The `TestSettingsImageAttribute` class provides metadata (image and name) for the assembly, used by the main UI to display the component in a component list or dashboard. The module does not perform runtime initialization logic beyond registration; all initialization is deferred to the container resolution of its types.
---
### 2. **Public Interface**
#### `TestSettingsModule` class
- **`TestSettingsModule(IUnityContainer unityContainer)`**
Constructor. Accepts a Unity container via dependency injection and stores it for later use in type registration.
- **`void Initialize()`**
Registers two types with the Unity container as *transient* (default Unity behavior unless otherwise specified):
- `ITestSettingsView``TestSettingsView`
- `ITestSettingsViewModel``TestSettingsViewModel`
*Note:* The source does **not** explicitly specify singleton lifetime — Unitys default registration is transient unless `.Singleton()` is used. However, the XML comment says “singleton” — this is inconsistent with the code and likely an error or documentation artifact.
- **`void OnInitialized(IContainerProvider containerProvider)`**
Empty implementation. No logic executed during Prisms `OnInitialized` pipeline.
- **`void RegisterTypes(IContainerRegistry containerRegistry)`**
Delegates to `Initialize()` — effectively re-runs the same type registrations. *Note:* This method receives a Prism `IContainerRegistry`, but internally uses the stored `_unityContainer` (of type `IUnityContainer`) instead of `containerRegistry`. This is likely unintended and may cause registration to fail or be inconsistent depending on how Prism wraps Unity.
#### `TestSettingsImageAttribute` class
- **`TestSettingsImageAttribute()`**
Default constructor; delegates to the parameterized constructor with `null`.
- **`TestSettingsImageAttribute(string s)`**
Constructor that initializes `_img` by calling `AssemblyInfo.GetImage(AssemblyNames.TestSettings.ToString())`.
- **`override eAssemblyRegion AssemblyRegion`**
Property that *always throws* `NotImplementedException`. Not functional.
- **`override BitmapImage AssemblyImage`**
Property that returns the result of `AssemblyInfo.GetImage(AssemblyNames.TestSettings.ToString())`. Cached in `_img` on first access.
- **`override Type GetAttributeType()`**
Returns `typeof(ImageAttribute)`.
- **`override BitmapImage GetAssemblyImage()`**
Returns the value of `AssemblyImage`.
- **`override string AssemblyName`**
Property that returns `"TestSettings"` (via `AssemblyNames.TestSettings.ToString()`). Cached in `_name`.
- **`override string GetAssemblyName()`**
Returns the value of `AssemblyName`.
- **`override eAssemblyRegion GetAssemblyRegion()`**
*Always throws* `NotImplementedException`. Not functional.
- **`override string AssemblyGroup`**
Property that returns `"Administrative"` (via `eAssemblyGroups.Administrative.ToString()`). Cached in `_group`.
- **`override string GetAssemblyGroup()`**
Returns the value of `AssemblyGroup`.
---
### 3. **Invariants**
- `TestSettingsModule` must be instantiated with a valid `IUnityContainer` instance; otherwise, `Initialize()` will throw `NullReferenceException`.
- `AssemblyInfo.GetImage(...)` and `AssemblyNames.TestSettings` must be defined and accessible at runtime; otherwise, `TestSettingsImageAttribute` constructors and property getters will throw exceptions (e.g., `NullReferenceException`, `KeyNotFoundException`, or custom exceptions from `AssemblyInfo`).
- `AssemblyRegion` and `GetAssemblyRegion()` are **non-functional** — any consumer relying on them will crash. This is a hard invariant failure point.
- `AssemblyGroup` is hardcoded to `"Administrative"` — no runtime variability is supported.
---
### 4. **Dependencies**
#### This module depends on:
- `Unity` (`IUnityContainer`)
- `Prism.Modularity` (`IModule`, `ModuleAttribute`)
- `Prism.Ioc` (`IContainerProvider`, `IContainerRegistry`)
- `DTS.Common` (specifically `AssemblyInfo`, `AssemblyNames`, `eAssemblyGroups`, `ImageAttribute`)
- `System.Windows.Media.Imaging` (`BitmapImage`)
- `System.ComponentModel.Composition` (`ExportAttribute`)
#### This module is depended on by:
- The **Prism bootstrapper/module catalog** — via `[Export(typeof(IModule))]` and `[Module(ModuleName = "TestSettings")]`, it is auto-discovered and loaded as a module named `"TestSettings"`.
- Any UI component that resolves `ITestSettingsView` or `ITestSettingsViewModel` via the Unity container.
- The main shell/application — via `TestSettingsImageAttribute` (likely applied at assembly level), used to render UI for this module (e.g., in a module list or dashboard).
---
### 5. **Gotchas**
- **Critical inconsistency in `RegisterTypes`**: The method receives `IContainerRegistry`, but internally calls `Initialize()`, which uses `_unityContainer` (`IUnityContainer`). This likely means registrations are performed on the *wrong container* (or the wrong container is passed in), potentially causing runtime resolution failures. This is a **high-risk bug**.
- **`AssemblyRegion` and `GetAssemblyRegion()` are unimplemented** — always throw `NotImplementedException`. Any code expecting these to return a valid region (e.g., for categorization) will crash.
- **XML comment claims singleton registration, but code does not enforce it** — Unity registers types as transient by default. If a singleton is required, `.Singleton()` must be explicitly used (e.g., `_unityContainer.RegisterType<ITestSettingsView, TestSettingsView>(new ContainerControlledLifetimeManager())`). This mismatch is a likely source of bugs.
- **`TestSettingsImageAttribute` constructor parameter `string s` is unused** — it is accepted but never assigned or used.
- **No validation or error handling** — e.g., if `AssemblyInfo.GetImage(...)` returns `null`, the property getter will propagate `null`, potentially causing downstream rendering issues (e.g., missing icons).
- **`AssemblyGroup` is hardcoded** — not configurable or data-driven, limiting flexibility.
None identified beyond the above.

View File

@@ -0,0 +1,37 @@
---
source_files:
- DataPRO/Modules/SystemSettings/TestSettings/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T04:43:04.407526+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "db8485e5f15a27e2"
---
# Properties
## 1. Purpose
This module is an assembly-level metadata configuration file (`AssemblyInfo.cs`) for the `TestSettings` project within the `DataPRO` codebase. Its purpose is to define standard .NET assembly attributes—such as title, version, and COM visibility—used for build-time identification, deployment, and interop compatibility. It does not contain application logic or runtime behavior; it solely provides metadata for the compiled assembly.
## 2. Public Interface
This file contains **no public types, functions, classes, or methods**. It is a declarative metadata file composed entirely of assembly-level attributes applied via the `System.Reflection` and `System.Runtime.InteropServices` namespaces.
## 3. Invariants
- The assembly is **not visible to COM** (`ComVisible(false)`), meaning it cannot be consumed by COM clients unless explicitly overridden per type (which is not done here).
- The assembly version is strictly `1.0.0.0` for both `AssemblyVersion` and `AssemblyFileVersion`.
- The `Guid` attribute is fixed at `7446722e-490d-4f6a-beaf-907947e576d5`, used only for COM type library identification (though irrelevant since `ComVisible` is `false`).
- All culture-specific attributes (`AssemblyCulture`, `AssemblyTrademark`) are empty or default, indicating no localization or trademark enforcement is declared at this level.
## 4. Dependencies
- **Depends on**:
- `System.Reflection` (for `AssemblyTitle`, `AssemblyVersion`, etc.)
- `System.Runtime.CompilerServices` (unused in this file, but imported)
- `System.Runtime.InteropServices` (for `ComVisible`, `Guid`)
- **Depended on by**:
- None directly—this is a metadata file. The compiled assembly (`TestSettings.dll`) may be referenced by other modules (e.g., test runners or system settings consumers), but no runtime dependencies are declared here.
## 5. Gotchas
- The `AssemblyVersion` is hardcoded to `1.0.0.0` with no wildcard (`*`) for automatic build/revision increments, meaning versioning must be manually updated.
- `AssemblyFileVersion` matches `AssemblyVersion`, which may limit deployment flexibility (e.g., side-by-side deployments requiring distinct file versions).
- `AssemblyCulture` is empty (`""`), indicating this is a *neutral-language* assembly (not satellite), but no `NeutralResourcesLanguage` attribute is present—this is not an error but may affect resource fallback behavior if localization is introduced later.
- The `Guid` is defined but unused in practice due to `ComVisible(false)`. Removing it would have no functional impact.
- None identified from source alone.

View File

@@ -0,0 +1,35 @@
---
source_files:
- DataPRO/Modules/SystemSettings/TestSettings/View/TestSettingsView.xaml.cs
generated_at: "2026-04-16T04:43:11.434114+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "76c02c5720fd2ff2"
---
# View
1. **Purpose**
This module defines the WPF view class `TestSettingsView`, which serves as the user interface layer for the test settings feature. It is a partial class implementing the `ITestSettingsView` interface, intended to provide a XAML-backed UI for displaying and editing system test configuration settings. Its role is strictly presentational—handling UI initialization and delegating data binding and logic to a corresponding view model (not shown here).
2. **Public Interface**
- **`TestSettingsView()`**
Public parameterless constructor. Calls `InitializeComponent()` to initialize the XAML-defined UI elements. No additional behavior is present in the provided source.
3. **Invariants**
- The class must be instantiated on a UI thread (as it is a WPF `Window`/`UserControl`-derived type, inferred from `InitializeComponent()` usage and XAML file association).
- `InitializeComponent()` must be called exactly once during construction; calling it again may cause runtime exceptions (standard WPF behavior, though not explicitly enforced in this snippet).
- The class is a partial class, implying a corresponding `TestSettingsView.xaml` file exists and must be compiled with the `x:Class` directive matching the namespace and class name.
4. **Dependencies**
- **Internal**: Depends on `TestSettingsView.xaml` (compiled as part of the same assembly), which defines the visual tree and UI elements.
- **External**:
- `DTS.Common.Interface.ITestSettingsView` — the interface this class implements; defines the contract for the view (e.g., data binding context, lifecycle hooks), though its members are not visible here.
- WPF framework (`System.Windows`, `System.Windows.Controls`, etc.) — implicitly via `partial class` and `InitializeComponent()`.
5. **Gotchas**
- The constructor performs no validation or configuration beyond `InitializeComponent()`; any setup logic (e.g., binding to a view model) is expected to occur elsewhere (e.g., in the view models constructor or via data context assignment in XAML or parent code).
- No event handlers or custom logic are defined in this file; all interactivity must be handled via XAML bindings or code-behind in other partial class files (not provided).
- The interface `ITestSettingsView` is referenced but not defined here—its contract (e.g., properties, methods) is unknown from this source alone.
- No null-safety or error handling is visible in the constructor; exceptions during `InitializeComponent()` (e.g., missing XAML resources) will propagate unhandled.
- *None identified from source alone.*

View File

@@ -0,0 +1,108 @@
---
source_files:
- DataPRO/Modules/SystemSettings/TestSettings/ViewModel/TestSettingsViewModel.cs
generated_at: "2026-04-16T04:43:11.486742+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "c0f752d14370c409"
---
# ViewModel
### **1. Purpose**
This module implements the `TestSettingsViewModel`, a Prism-based MVVM view model responsible for managing the UI state and interaction patterns for the Test Settings feature within the application. It acts as the data context for `ITestSettingsView`, coordinates with the Prism infrastructure (region management, event aggregation, Unity container), and exposes interaction requests for displaying notifications and confirmation dialogs. Though named `TestSettingsViewModel`, the current implementation is largely skeletal—providing boilerplate lifecycle hooks and property change notifications—but does not yet contain domain-specific logic for test settings.
---
### **2. Public Interface**
#### **Properties**
- `bool IsDirty { get; private set; }`
A read-only property indicating whether the view models state has unsaved changes. Currently always `false` (no implementation to set it).
- `bool IsBusy { get; set; }`
Gets or sets a flag indicating whether the UI is in a busy state (e.g., processing). Raises `PropertyChanged` for `"IsBusy"` on change.
- `bool IsMenuIncluded { get; set; }`
Gets or sets whether the menu UI element should be included. Raises `PropertyChanged` for `"IsMenuIncluded"` on change. Defaults to `false`.
- `bool IsNavigationIncluded { get; set; }`
Gets or sets whether the navigation UI element should be included. Raises `PropertyChanged` for `"IsNavigationIncluded"` on change. Defaults to `false`.
- `string HeaderInfo { get; }`
Returns the hardcoded string `"MainRegion"`—used as a header identifier (likely for region naming or layout).
#### **Interaction Requests**
- `InteractionRequest<Notification> NotificationRequest { get; }`
Exposes a Prism `InteractionRequest` for triggering notification popups (e.g., informational messages). Used by `OnRaiseNotification`.
- `InteractionRequest<Confirmation> ConfirmationRequest { get; }`
Exposes a Prism `InteractionRequest` for confirmation dialogs (e.g., yes/no prompts). Currently unused in the source.
#### **Methods**
- `void Cleanup()`
Lifecycle hook for cleanup. Currently empty.
- `Task CleanupAsync()`
Async version of `Cleanup()`. Returns `Task.CompletedTask`.
- `void Initialize()`
Parameterless initialization hook. Currently empty.
- `void Initialize(object parameter)`
Initialization with a single parameter. Currently empty.
- `void Initialize(object parameter, object model)`
Initialization with parameter and model. Currently empty.
- `Task InitializeAsync()`
Async initialization without parameters. Returns `Task.CompletedTask`.
- `Task InitializeAsync(object parameter)`
Async initialization with parameter. Returns `Task.CompletedTask`.
- `void Activated()`
Lifecycle hook called when the view is activated. Currently empty.
---
### **3. Invariants**
- `IsBusy` must always be set via the property setter to ensure `OnPropertyChanged("IsBusy")` is raised. Direct field access bypasses change notification.
- `IsMenuIncluded` and `IsNavigationIncluded` follow the same invariant: changes must go through the property setter to notify UI.
- `HeaderInfo` is a constant `"MainRegion"` and never changes.
- `NotificationRequest` and `ConfirmationRequest` are initialized in the constructor and never reassigned.
- The `OnPropertyChanged` method is invoked only via the property setters or `OnRaiseNotification`/`OnBusyIndicatorNotification` handlers.
---
### **4. Dependencies**
#### **Imports / Dependencies Used**
- **Prism Libraries**:
- `Prism.Events.IEventAggregator` — for subscribing to events like `RaiseNotification` and `BusyIndicatorChangeNotification`.
- `Prism.Regions.IRegionManager` — for region management (used in constructor but not yet utilized in logic).
- `Prism.Interactivity.InteractionRequest<Notification/Confirmation>` — for UI interaction patterns.
- **Unity Container**:
- `Unity.IUnityContainer` — injected via constructor, likely for service resolution (not used beyond storage).
- **Custom DTS Common Libraries**:
- `DTS.Common.Base` — base types (e.g., `IBasePropertyChanged`).
- `DTS.Common.Events` — defines `RaiseNotification`, `BusyIndicatorChangeNotification`, and `NotificationContentEventArgs`.
- `DTS.Common.Interactivity` — likely contains `Notification`, `NotificationContentEventArgs`, and `Confirmation` types.
- `DTS.Common.Interface` — defines `ITestSettingsView` and `ITestSettingsViewModel`.
#### **Consumers / Dependents**
- The view `ITestSettingsView` (likely XAML) binds to this view models properties (`IsBusy`, `IsMenuIncluded`, etc.) and interaction requests.
- Event publishers (e.g., `RaiseNotification` and `BusyIndicatorChangeNotification` events) depend on this view model subscribing to them.
---
### **5. Gotchas**
- **`SetProperty` throws `NotImplementedException`**: The `SetProperty<T>` method (likely intended for use with `INotifyPropertyChanged` helpers) is unimplemented and will crash if called. This suggests incomplete migration from a base class or missing refactoring.
- **`IBasePropertyChanged.OnPropertyChanged` is implemented explicitly**: While `OnPropertyChanged` is public, the explicit interface implementation may cause confusion if callers expect to invoke it via the interface directly without casting.
- **`NotificationRequest` expects `NotificationContentEventArgsWithoutTitle` internally**: The `OnRaiseNotification` handler constructs a new `NotificationContentEventArgs` with empty strings for title and footer, but the XML comment incorrectly refers to `NotificationContentEventArgsWithoutTitle` (which does not appear in the source). This may indicate a mismatch between documentation and actual types.
- **`HeaderInfo` is hardcoded**: Its value `"MainRegion"` suggests it may be used as a region name, but this is not validated or enforced—misuse could cause region resolution issues.
- **No actual test settings logic**: Despite the name, the view model contains no domain-specific behavior. This may be intentional (stubbed for future work) or a naming artifact.
- **`IsDirty` is never set**: Though declared, there is no logic to track dirty state—any UI expecting this to drive save-button states will be non-functional.
- **`Cleanup`/`Initialize` methods are empty**: These lifecycle hooks are standard in Prism but currently serve no purpose—could lead to confusion if consumers expect side effects.
*None identified beyond the above.*

View File

@@ -0,0 +1,119 @@
---
source_files:
- DataPRO/Modules/SystemSettings/UISettings/UISettingsModule.cs
generated_at: "2026-04-16T04:39:31.289860+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "b65049df89cf8545"
---
# UISettings
## Documentation: `UISettingsModule` (DataPRO/Modules/SystemSettings/UISettings/UISettingsModule.cs)
---
### **1. Purpose**
This module registers the UI settings view and view model as singleton services within the Unity dependency injection container for use in the applications system settings UI. It serves as the Prism module entry point for the *UISettings* feature, enabling modular loading and dependency resolution of the UI settings component. It also provides assembly-level metadata (image and group) via the `UISettingsImageAttribute`, allowing the main screen to display the module as part of the *Administrative* group.
---
### **2. Public Interface**
#### **Class: `UISettingsModule`**
- **`public UISettingsModule(IUnityContainer unityContainer)`**
Constructor. Accepts a Unity container via dependency injection and stores it for later use in type registration.
- **`public void Initialize()`**
Registers the `IUISettingsView` interface to `UISettingsView`, and `IUISettingsViewModel` to `UISettingsViewModel`, both as singleton registrations in the Unity container.
- **`public void OnInitialized(IContainerProvider containerProvider)`**
Currently empty; no logic implemented.
- **`public void RegisterTypes(IContainerRegistry containerRegistry)`**
Delegates to `Initialize()`, performing the same type registrations. *(Note: `IContainerRegistry` is a Prism abstraction, but `Initialize()` uses `IUnityContainer` directly — see **Gotchas**.)*
#### **Attribute: `UISettingsImageAttribute`**
- **`public UISettingsImageAttribute()`**
Default constructor; delegates to the overloaded constructor with `null`.
- **`public UISettingsImageAttribute(string s)`**
Constructor accepting a string parameter (unused); initializes `_img` by calling `AssemblyInfo.GetImage(AssemblyNames.UISettings.ToString())`.
- **`public override BitmapImage AssemblyImage { get; }`**
Returns the assembly image for *UISettings*, retrieved via `AssemblyInfo.GetImage(...)`. Uses lazy initialization (caches in `_img`).
- **`public override Type GetAttributeType()`**
Returns `typeof(ImageAttribute)`.
- **`public override BitmapImage GetAssemblyImage()`**
Returns the value of `AssemblyImage`.
- **`public override string AssemblyName { get; }`**
Returns `"UISettings"` (from `AssemblyNames.UISettings.ToString()`), cached in `_name`.
- **`public override string GetAssemblyName()`**
Returns the value of `AssemblyName`.
- **`public override string AssemblyGroup { get; }`**
Returns `"Administrative"` (from `eAssemblyGroups.Administrative.ToString()`), cached in `_group`.
- **`public override string GetAssemblyGroup()`**
Returns the value of `AssemblyGroup`.
- **`public override eAssemblyRegion AssemblyRegion { get; }`**
Throws `NotImplementedException` — not implemented.
- **`public override eAssemblyRegion GetAssemblyRegion()`**
Throws `NotImplementedException` — not implemented.
---
### **3. Invariants**
- `UISettingsModule` **must** be loaded as a Prism module (via `[Export(typeof(IModule))]` and `[Module(ModuleName = "UISettings")]`).
- `IUISettingsView` and `IUISettingsViewModel` are registered as **singleton** instances in the Unity container during module initialization.
- `AssemblyImage`, `AssemblyName`, and `AssemblyGroup` are **statically derived** from `AssemblyNames.UISettings` and `eAssemblyGroups.Administrative`, and are expected to be consistent across builds.
- `AssemblyRegion` and `GetAssemblyRegion()` are **not implemented** — callers must avoid invoking them.
---
### **4. Dependencies**
#### **Imports (from source):**
- `System`, `System.ComponentModel.Composition`, `System.Windows.Media.Imaging` — WPF imaging and MEF support.
- `DTS.Common` and `DTS.Common.Interface` — internal common library (contains `AssemblyInfo`, `AssemblyNames`, `eAssemblyGroups`, `ImageAttribute`, `eAssemblyRegion`).
- `Prism.Ioc`, `Prism.Modularity` — Prism framework for DI and module loading.
- `Unity` — Unity container API (`IUnityContainer`, `IContainerRegistry`).
#### **Consumers (inferred):**
- The **Prism bootstrapper/module catalog** — loads `UISettingsModule` at runtime.
- The **main UI shell** — consumes `UISettingsImageAttribute` (via assembly-level attribute reflection) to render module metadata (image, name, group).
- Any code resolving `IUISettingsView` or `IUISettingsViewModel` via Unity — e.g., views, view models, or services needing to display or interact with the UI settings UI.
---
### **5. Gotchas**
- **`RegisterTypes` uses Prisms `IContainerRegistry`, but internally calls `Initialize()` which uses Unitys `IUnityContainer`.**
This implies tight coupling to Unity and may break if the container abstraction changes or if the module is used in a non-Unity Prism setup. The `containerRegistry` parameter is unused.
- **`AssemblyRegion` and `GetAssemblyRegion()` throw `NotImplementedException`.**
Any code expecting region metadata (e.g., for UI grouping or filtering) will crash if this attribute is used in that context.
- **`_img`, `_name`, and `_group` are lazily initialized and cached in private fields, but not thread-safely.**
While unlikely to cause issues (assembly metadata is typically read once at startup), concurrent access during initialization could lead to race conditions.
- **The `string s` parameter in `UISettingsImageAttribute(string s)` is unused.**
Likely legacy or placeholder; may mislead developers into thinking it configures something.
- **No validation is performed on `AssemblyInfo.GetImage(...)`.**
If the image resource is missing or malformed, the exception occurs at runtime (e.g., `NullReferenceException` or WPF imaging error), not at registration time.
- **`OnInitialized` is empty — no post-initialization logic is defined.**
If future logic is added here, it must be compatible with the current singleton registration model.
---
*Documentation generated from `DataPRO/Modules/SystemSettings/UISettings/UISettingsModule.cs`.*

View File

@@ -0,0 +1,40 @@
---
source_files:
- DataPRO/Modules/SystemSettings/UISettings/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T04:41:03.227473+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "64539cdc887858f3"
---
# Properties
## 1. Purpose
This module (`DataPRO.Modules.SystemSettings.UISettings`) is an assembly containing UI-related settings functionality for the DataPRO system. Based on the assembly name and namespace structure, it serves as a dedicated module for managing user interface configuration—likely including persistence, serialization, and access to UI state or preferences. However, the provided source file (`AssemblyInfo.cs`) contains only assembly-level metadata (e.g., title, version, COM visibility) and no implementation logic; thus, the actual behavior and data structures for UI settings are defined elsewhere in the module and not visible in this file.
## 2. Public Interface
**No public API surface is exposed in this file.**
`AssemblyInfo.cs` is a metadata file used by the .NET build system and runtime to describe the assembly (e.g., version, GUID, COM visibility). It defines no types, classes, methods, properties, or constants that constitute a public interface. All public APIs for UI settings functionality reside in other source files within the `DataPRO.Modules.SystemSettings.UISettings` namespace (e.g., likely in classes such as `UISettingsManager`, `UISettingsModel`, etc.), but those are not included in the provided source.
## 3. Invariants
**No invariants can be derived from this file.**
Assembly metadata does not enforce runtime invariants or constraints. The only implicit invariant is that the assemblys identity (as defined by `AssemblyVersion`, `AssemblyFileVersion`, and `Guid`) remains stable across builds unless intentionally changed.
## 4. Dependencies
**Dependencies inferred from imports:**
- `System.Reflection`
- `System.Runtime.CompilerServices`
- `System.Runtime.InteropServices`
These are standard .NET namespaces used for reflection, compiler services, and COM interop. No external project or module dependencies are declared in this file.
**Dependents:**
This assembly (`UISettings`) is likely referenced by other modules in the `DataPRO.Modules.SystemSettings` hierarchy (e.g., `SystemSettings` core module) or by UI layers (e.g., WPF/WinForms clients), but such references are not visible in `AssemblyInfo.cs`.
## 5. Gotchas
- **Misleading file scope**: Developers may mistakenly assume this file contains UI settings logic. It does not—it is strictly metadata. Actual implementation resides in other files (e.g., `UISettings.cs`, `SettingsStore.cs`, etc.).
- **COM visibility**: `ComVisible(false)` is set, meaning types in this assembly are not exposed to COM by default. If COM interop is required (e.g., for legacy integration), this must be explicitly enabled per type.
- **Versioning**: Both `AssemblyVersion` and `AssemblyFileVersion` are hardcoded to `1.0.0.0`. This may indicate a placeholder or early-stage assembly; in production, these should be updated per release strategy (e.g., via CI/CD).
- **No functional behavior**: This file contributes no runtime behavior—any bugs or quirks related to UI settings logic are absent here and must be sought in other files.
- **GUID stability**: The `Guid("7446722e-490d-4f6a-beaf-907947e576d5")` is fixed for COM registration. Changing it may break COM-based integrations or tooling that relies on typelib identification.
None identified beyond the above.

View File

@@ -0,0 +1,39 @@
---
source_files:
- DataPRO/Modules/SystemSettings/UISettings/View/ISOSettingsView.xaml.cs
generated_at: "2026-04-16T04:41:11.832959+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "43f3c8acaf3adca4"
---
# View
### 1. **Purpose**
This module defines the WPF view class `UISettingsView`, which serves as the UI layer implementation for the `IUISettingsView` interface. It is responsible for rendering the user interface for system settings (specifically ISO-related settings, per the parent folder path `ISOSettingsView.xaml.cs`), leveraging WPFs XAML-based UI initialization via `InitializeComponent()`. Its role is purely presentational—no business logic is embedded in this class—and it acts as a bridge between the UI framework and the underlying settings view contract.
### 2. **Public Interface**
- **`public partial class UISettingsView : IUISettingsView`**
A WPF `UserControl` (inferred from XAML context and naming) implementing the `IUISettingsView` interface from `DTS.Common.Interface`.
- **Constructor: `public UISettingsView()`**
Initializes the WPF component by calling `InitializeComponent()`—this method is auto-generated by the XAML compiler and wires up UI elements defined in `UISettingsView.xaml`. No additional initialization logic is present in the provided source.
### 3. **Invariants**
- The class must be instantiated on the UI thread (standard WPF requirement, though not explicitly enforced in code).
- `InitializeComponent()` must be called exactly once during construction; calling it again may cause runtime errors (e.g., duplicate names in the visual tree).
- The class is `partial`, implying that the full definition is split between this file and an auto-generated `UISettingsView.g.i.cs` (or similar) containing the `InitializeComponent()` implementation and field declarations for named XAML elements.
- No validation or state management is performed in the constructor—any constraints or preconditions are expected to be handled by consumers or higher-level components.
### 4. **Dependencies**
- **Direct dependency**: `DTS.Common.Interface.IUISettingsView` — the interface this class implements.
- **Implicit dependencies**:
- WPF framework (`System.Windows`, `System.Windows.Controls`, etc.) — required for `UserControl` and `InitializeComponent()`.
- `UISettingsView.xaml` — the XAML file defining the visual structure (not included in source, but required at compile/runtime).
- **Consumers**: Likely consumed by a view model or presenter (e.g., via MVVM pattern) that binds to `IUISettingsView`, though no direct usage is visible in this file.
### 5. **Gotchas**
- **Ambiguous naming**: The file path `ISOSettingsView.xaml.cs` suggests ISO-specific settings, but the class is named `UISettingsView`—this may indicate a naming inconsistency or refactoring artifact.
- **No logic in constructor**: Developers may mistakenly assume configuration or initialization logic resides here; in fact, the constructor is minimal and delegates all UI setup to `InitializeComponent()`.
- **Interface contract unknown**: The behavior and expectations of `IUISettingsView` are not visible in this file—consumers must refer to its definition in `DTS.Common.Interface` to understand required functionality.
- **No error handling or guards**: Absence of null checks, exception handling, or validation means runtime failures (e.g., missing XAML resources) will propagate unhandled.
- **None identified from source alone.**

View File

@@ -0,0 +1,129 @@
---
source_files:
- DataPRO/Modules/SystemSettings/UISettings/ViewModel/ISOSettingsViewModel.cs
generated_at: "2026-04-16T04:41:03.637144+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "38bf1bb83bea5e37"
---
# ViewModel
## Documentation: `UISettingsViewModel`
---
### 1. **Purpose**
`UISettingsViewModel` is the view model for the UI Settings module, responsible for managing UI-related state and mediating interactions between the view (`IUISettingsView`) and the broader application infrastructure (e.g., event aggregation, region management, dependency injection). It implements the `IUISettingsViewModel` interface and is exported as a shared singleton via MEF (`[Export(typeof(IUISettingsView))]`). Its primary role is to expose properties that control UI layout (e.g., `IsMenuIncluded`, `IsNavigationIncluded`) and to translate application-level events (`RaiseNotification`, `BusyIndicatorChangeNotification`) into Prism `InteractionRequest` triggers for UI notifications and busy indicators.
---
### 2. **Public Interface**
#### `class UISettingsViewModel : BasePropertyChanged, IUISettingsViewModel`
- **Constructor**
```csharp
public UISettingsViewModel(IUISettingsView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
```
Initializes the view model with required dependencies, sets `View.DataContext = this`, registers event handlers for `RaiseNotification` and `BusyIndicatorChangeNotification` events, and initializes `NotificationRequest` and `ConfirmationRequest`.
- **`void Cleanup()`**
No-op stub. Intended for cleanup logic but currently does nothing.
- **`Task CleanupAsync()`**
Returns `Task.CompletedTask`. No-op stub for async cleanup.
- **`void Initialize()`**
No-op stub.
- **`void Initialize(object parameter)`**
No-op stub.
- **`void Initialize(object parameter, object model)`**
No-op stub.
- **`Task InitializeAsync()`**
Returns `Task.CompletedTask`. No-op stub.
- **`Task InitializeAsync(object parameter)`**
Returns `Task.CompletedTask`. No-op stub.
- **`void Activated()`**
No-op stub.
#### Properties
- **`IUISettingsView View { get; }`**
Reference to the associated view instance. Set during construction.
- **`InteractionRequest<Notification> NotificationRequest { get; }`**
Prism `InteractionRequest` used to trigger notification popups (e.g., informational messages).
- **`InteractionRequest<Confirmation> ConfirmationRequest { get; }`**
Prism `InteractionRequest` for confirmation dialogs (declared but *not used* in current implementation).
- **`bool IsDirty { get; }`**
Read-only property; always `false` (never set). Intended for tracking unsaved changes.
- **`bool IsBusy { get; set; }`**
Bindable property reflecting busy state. Set via `OnBusyIndicatorNotification(bool)` in response to `BusyIndicatorChangeNotification` events.
- **`bool IsMenuIncluded { get; set; }`**
Bindable property indicating whether the menu UI element should be included. Defaults to `false`.
- **`bool IsNavigationIncluded { get; set; }`**
Bindable property indicating whether the navigation UI element should be included. Defaults to `false`.
- **`string HeaderInfo { get; }`**
Returns the constant `"MainRegion"`. Used as a header identifier (purpose unclear without further context).
---
### 3. **Invariants**
- `View.DataContext` is always set to `this` during construction.
- `IsBusy` is updated *only* in response to `BusyIndicatorChangeNotification` events (via `OnBusyIndicatorNotification`).
- `NotificationRequest` is triggered *only* via `OnRaiseNotification`, which wraps `NotificationContentEventArgs` into a `Notification` object with an empty `Message` and `Title` fields in the inner `NotificationContentEventArgs` (see `Gotchas`).
- `IsDirty` is never set to `true`; its value is always `false`.
- `IsMenuIncluded` and `IsNavigationIncluded` default to `false` and are mutable via property setters.
---
### 4. **Dependencies**
#### Imports / Dependencies
- **Prism**: `IEventAggregator`, `IRegionManager`, `InteractionRequest<T>`, `Notification`, `Confirmation`.
- **Unity**: `IUnityContainer`.
- **DTS Common Libraries**:
- `DTS.Common.Base.BasePropertyChanged` (base class for property change notifications).
- `DTS.Common.Events.RaiseNotification`, `BusyIndicatorChangeNotification` (event types).
- `DTS.Common.Interactivity.NotificationContentEventArgs`, `NotificationContentEventArgsWithoutTitle` (used in event handling).
- `DTS.Common.Interface.IUISettingsView`, `IUISettingsViewModel` (view/view model interfaces).
- **MEF**: `[Export]` and `[PartCreationPolicy(CreationPolicy.Shared)]` indicate integration with a MEF-based composition container.
#### Depends On
- `IUISettingsView` (the view it binds to).
- `RaiseNotification` and `BusyIndicatorChangeNotification` events (published externally).
- `NotificationContentEventArgs` and `NotificationContentEventArgsWithoutTitle` types (used in event handling logic).
#### Consumed By
- The application shell or main region manager (via `IRegionManager`) to host this view models view.
- Any module/component that publishes `RaiseNotification` or `BusyIndicatorChangeNotification` events.
---
### 5. **Gotchas**
- **`NotificationContentEventArgsWithoutTitle` is referenced in comments but not defined in source**: The comment in `OnRaiseNotification` mentions `NotificationContentEventArgsWithoutTitle`, but this type is not imported or used in the code. This suggests either:
- A mismatch between documentation and implementation, or
- A missing type definition (potential compile-time error if not defined elsewhere).
- **`NotificationRequest` uses a modified `NotificationContentEventArgs`**: In `OnRaiseNotification`, a new `NotificationContentEventArgs` is constructed with empty strings for `Title` and `Message` fields (`new NotificationContentEventArgs(eventArgsWithTitle.Message, "", eventArgsWithTitle.Image, "")`). This contradicts the comment that says it expects a `NotificationContentEventArgsWithoutTitle` object. Likely indicates legacy or incomplete refactoring.
- **`ConfirmationRequest` is declared but never used**: No code raises `ConfirmationRequest`, suggesting it is unused or reserved for future use.
- **`IsDirty` is never updated**: Despite being a public property, it is never set to `true`, making it effectively inert. This may indicate incomplete implementation or a design oversight.
- **`HeaderInfo` returns a hardcoded `"MainRegion"`**: Its purpose is unclear; it may be a remnant of region naming conventions but is not used in the current code.
- **`Initialize*` and `Cleanup*` methods are no-ops**: All overloads are stubbed. If the module expects initialization logic (e.g., loading settings), it is not implemented here.
- **Thread context for `BusyIndicatorChangeNotification`**: The subscription uses `ThreadOption.PublisherThread`, meaning the handler runs on the publishers thread. If publishers are non-UI threads, this could cause cross-thread UI exceptions unless `SetProperty` (from `BasePropertyChanged`) is thread-safe.
> **Note**: No usage of `UnityContainer`, `_regionManager`, or `_eventAggregator` beyond initialization and event subscription is present. Their purpose is unclear in the current implementation.