init
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Diagnostics/Properties/Settings.Designer.cs
|
||||
- DataPRO/Modules/TestSetups/Diagnostics/Properties/AssemblyInfo.cs
|
||||
generated_at: "2026-04-16T04:51:04.800084+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "a0502aa255ed79b1"
|
||||
---
|
||||
|
||||
# Properties
|
||||
|
||||
## Documentation Page: Diagnostics Module Settings
|
||||
|
||||
### 1. Purpose
|
||||
This module provides application-level settings infrastructure for the *Diagnostics* submodule within the TestSetups module of the DataPRO system. It exposes a strongly-typed settings class (`Diagnostics.Properties.Settings`) derived from `ApplicationSettingsBase`, enabling centralized, persisted configuration access for diagnostic-related runtime parameters. The module itself contains no executable logic beyond the auto-generated settings infrastructure—it serves as a configuration contract point for the diagnostics module, likely consumed by other components in the diagnostics pipeline (e.g., test setup validation, diagnostic reporting, or hardware interaction modules).
|
||||
|
||||
### 2. Public Interface
|
||||
The module exposes only one public type:
|
||||
|
||||
- **`Diagnostics.Properties.Settings`**
|
||||
- **Type**: `internal sealed partial class` inheriting from `System.Configuration.ApplicationSettingsBase`
|
||||
- **Static Property**: `public static Settings Default { get; }`
|
||||
- Returns the singleton, thread-safe instance of the settings class.
|
||||
- Internally uses `ApplicationSettingsBase.Synchronized()` to ensure thread safety.
|
||||
- **Note**: No custom settings properties are defined in the provided source. The class is auto-generated and currently contains *no user-defined settings* beyond the default `ApplicationSettingsBase` behavior (e.g., default constructor, `Item[string]` indexer, etc.). Any settings would be added via Visual Studio’s Settings designer and regenerated into this file.
|
||||
|
||||
### 3. Invariants
|
||||
- The `Default` property always returns a non-null, synchronized instance of `Settings`.
|
||||
- The class is `sealed` and `partial`, indicating it is not extensible via inheritance and may be partially regenerated.
|
||||
- Thread-safety is enforced for the singleton instance via `Synchronized()`, but *no other thread-safety guarantees* are provided for individual property access (as is standard for `ApplicationSettingsBase`).
|
||||
- The assembly version is fixed at `1.0.0.0` (both `AssemblyVersion` and `AssemblyFileVersion`), with no build/revision auto-increment.
|
||||
|
||||
### 4. Dependencies
|
||||
- **Depends on**:
|
||||
- `System.Configuration` (for `ApplicationSettingsBase`)
|
||||
- `System.Runtime.CompilerServices` (for `CompilerGeneratedAttribute`)
|
||||
- `System.CodeDom.Compiler` (for `GeneratedCodeAttribute`)
|
||||
- **Depended on by**:
|
||||
- Other modules/components in the `Diagnostics` namespace (e.g., test setup validators, diagnostic runners) that consume diagnostic configuration.
|
||||
- The broader `DataPRO` system via the `Diagnostics` assembly (GUID: `c91752c2-0792-475c-be1e-bc1aff79e56e`).
|
||||
- **Assembly metadata** indicates it is part of the `Diagnostics` product, owned by `DTS`, and is not COM-visible.
|
||||
|
||||
### 5. Gotchas
|
||||
- **Auto-generated file**: Manual edits will be overwritten on regeneration (e.g., via Visual Studio’s Settings designer).
|
||||
- **No settings defined**: The current `Settings` class contains *no user-defined properties*—it is a skeleton. Any configuration behavior must be added externally and regenerated into this file.
|
||||
- **Thread-safety scope**: While the `Default` instance is synchronized, accessing individual settings properties (once defined) is *not* guaranteed thread-safe beyond the base `ApplicationSettingsBase` semantics.
|
||||
- **Versioning**: Hardcoded version `1.0.0.0` may indicate legacy or placeholder status; verify if versioning is intentionally static or an oversight.
|
||||
- **No documentation comments**: The source lacks XML documentation, making it unclear what settings *should* be present or their semantics.
|
||||
@@ -0,0 +1,69 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Diagnostics/Resources/TranslateExtension.cs
|
||||
- DataPRO/Modules/TestSetups/Diagnostics/Resources/StringResources.Designer.cs
|
||||
generated_at: "2026-04-16T04:50:59.405186+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "8602aa2c75632a3b"
|
||||
---
|
||||
|
||||
# Resources
|
||||
|
||||
## Documentation: `TranslateExtension` Markup Extension
|
||||
|
||||
---
|
||||
|
||||
### 1. Purpose
|
||||
The `TranslateExtension` class is a WPF `MarkupExtension` used to resolve localized string resources at XAML runtime. It enables declarative binding to localized strings in UI markup by accepting a resource key and returning the corresponding localized value from the `StringResources` strongly-typed resource class. This allows UI text to be localized without hardcoding strings in XAML, supporting multi-language deployments of the diagnostics module.
|
||||
|
||||
---
|
||||
|
||||
### 2. Public Interface
|
||||
|
||||
#### `TranslateExtension(string key)`
|
||||
- **Signature**: `public TranslateExtension(string key)`
|
||||
- **Behavior**: Constructor. Stores the provided resource key for later lookup. Does not perform validation beyond null/empty checks during `ProvideValue`.
|
||||
|
||||
#### `ProvideValue(IServiceProvider serviceProvider)`
|
||||
- **Signature**: `public override object ProvideValue(IServiceProvider serviceProvider)`
|
||||
- **Behavior**:
|
||||
- If `_key` is `null` or empty, returns `"#stringnotfound#"`.
|
||||
- Otherwise, attempts to retrieve the string value from `StringResources.ResourceManager.GetString(_key)`.
|
||||
- If the resource is not found (i.e., `GetString` returns `null`), returns `"#stringnotfound# " + _key` (note the trailing space).
|
||||
- Returns a `string` (as indicated by `[MarkupExtensionReturnType(typeof(string))]`).
|
||||
|
||||
---
|
||||
|
||||
### 3. Invariants
|
||||
- `_key` is immutable after construction (stored in a `readonly` field).
|
||||
- The returned value is always a `string`.
|
||||
- Missing or empty keys **always** yield `"#stringnotfound#"` (no concatenation with key).
|
||||
- Missing resources **always** yield `"#stringnotfound# <key>"` (with a space between the prefix and key).
|
||||
- No exceptions are thrown during `ProvideValue`—errors are silently handled via fallback strings.
|
||||
- Resource lookup uses the default `ResourceManager` instance and current UI culture (unless overridden via `StringResources.Culture`).
|
||||
|
||||
---
|
||||
|
||||
### 4. Dependencies
|
||||
|
||||
#### Dependencies *of* `TranslateExtension`:
|
||||
- `System.Windows.Markup.MarkupExtension` (base class, part of WPF).
|
||||
- `Diagnostics.Resources.StringResources` (specifically its `ResourceManager` property and `GetString(string)` method).
|
||||
- `System` (for `string.IsNullOrEmpty`, `object.ReferenceEquals`, etc.).
|
||||
|
||||
#### Dependencies *on* `TranslateExtension`:
|
||||
- XAML files in the diagnostics module (e.g., `.xaml` files) that use `{local:Translate KeyName}` syntax to bind UI text.
|
||||
- `StringResources.Designer.cs` must be compiled and available at runtime (auto-generated; relies on corresponding `.resx` file, not visible here).
|
||||
|
||||
---
|
||||
|
||||
### 5. Gotchas
|
||||
- **No null-safety for `_key` beyond emptiness**: Passing `null` as `_key` is allowed in the constructor but results in `"#stringnotfound#"` at runtime.
|
||||
- **Ambiguous fallbacks**: Both missing keys and empty keys produce `"#stringnotfound#"`, making debugging harder without inspecting the key itself.
|
||||
- **Hardcoded prefix**: The `"#stringnotfound#"` string is hardcoded and not configurable. If this prefix appears in actual resources, it may cause confusion.
|
||||
- **No caching of resolved values**: Each `ProvideValue` call re-invokes `ResourceManager.GetString`, which may have performance implications in high-frequency scenarios (though `ResourceManager` itself caches internally).
|
||||
- **Culture dependency**: Behavior depends on the current UI thread’s `Culture` (via `StringResources.Culture`). If the UI culture changes dynamically, existing bindings may not update unless re-evaluated.
|
||||
- **No compile-time key validation**: Typos in XAML resource keys (e.g., `{local:Translate Channles}`) will only surface at runtime as `"#stringnotfound# Channles"`.
|
||||
|
||||
None identified beyond the above.
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Diagnostics/View/DiagnosticsTreeView.xaml.cs
|
||||
generated_at: "2026-04-16T04:51:08.211908+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "0a0fe72fbe0be4ed"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
## Documentation: `DiagnosticsTreeView` Class
|
||||
|
||||
### 1. Purpose
|
||||
The `DiagnosticsTreeView` class provides the WPF UI implementation for a tree-view control used to display diagnostic data in the test setup diagnostics module. It serves as the concrete view layer implementing the `IDiagnosticsTreeView` interface, handling the visual representation and user interaction for hierarchical diagnostic information (e.g., test steps, subtests, or diagnostic nodes). Its existence enables separation of UI logic from business logic, adhering to MVVM or similar patterns where `IDiagnosticsTreeView` defines the contract for view interactions.
|
||||
|
||||
### 2. Public Interface
|
||||
The class is `partial`, implying its full definition is split between this file and `DiagnosticsTreeView.xaml`. From the provided source, only the following is publicly exposed:
|
||||
|
||||
- **`public DiagnosticsTreeView()`**
|
||||
Constructor. Calls `InitializeComponent()` to load and wire up the XAML-defined UI elements. No additional initialization logic is visible in this file.
|
||||
|
||||
*Note:* No other public methods, properties, or events are declared in this file. Any additional public members (e.g., event handlers, dependency properties, or interface implementations) must be defined in the corresponding `DiagnosticsTreeView.xaml` or other partial files, which are not included here.
|
||||
|
||||
### 3. Invariants
|
||||
No explicit invariants (e.g., state constraints, validation rules, ordering guarantees) are declared or inferable from this file alone. The class relies on WPF’s standard tree-view behavior (e.g., `ItemsControl` semantics), but no custom invariants are enforced in the provided code.
|
||||
|
||||
### 4. Dependencies
|
||||
- **Direct Dependencies (via `using`):**
|
||||
- `System.Windows.*` (WPF core namespaces: `System.Windows`, `System.Windows.Controls`, `System.Windows.Data`, `System.Windows.Media`)
|
||||
- `DTS.Common.Interface.TestSetups.Diagnostics` — specifically, the `IDiagnosticsTreeView` interface (referenced via `inheritdoc`).
|
||||
- **Implicit Dependencies:**
|
||||
- `DiagnosticsTreeView.xaml` — required for `InitializeComponent()` to succeed (contains UI layout and element definitions).
|
||||
- `IDiagnosticsTreeView` interface — must be defined in `DTS.Common.Interface.TestSetups.Diagnostics` and implemented by this class.
|
||||
- **Depended upon:**
|
||||
- Likely consumed by a corresponding view model (e.g., `DiagnosticsTreeViewModel`) that binds to this view via `IDiagnosticsTreeView`. The interface contract (`IDiagnosticsTreeView`) enables inversion of control.
|
||||
|
||||
### 5. Gotchas
|
||||
- **Incomplete visibility:** The class is `partial`, and no members beyond the constructor are visible in this file. Behavior, event handling, and data binding logic reside in `DiagnosticsTreeView.xaml` and other partial definitions, which are not provided.
|
||||
- **Interface implementation:** While `IDiagnosticsTreeView` is referenced, its contract (methods/properties) is not included here. Consumers must rely on the interface definition in `DTS.Common.Interface.TestSetups.Diagnostics`.
|
||||
- **No logic in constructor:** The constructor does not initialize data or set up bindings—this is expected to be handled via XAML data binding (e.g., `DataContext` assignment in XAML or by a framework).
|
||||
- **Namespace quirk:** `// ReSharper disable CheckNamespace` suggests the namespace is intentionally `Diagnostics` (not nested under a deeper module), which may conflict with standard naming conventions and could cause ambiguity.
|
||||
|
||||
*None identified from source alone.*
|
||||
@@ -0,0 +1,122 @@
|
||||
---
|
||||
source_files:
|
||||
- DataPRO/Modules/TestSetups/Diagnostics/ViewModel/DiagnosticsViewModel.cs
|
||||
generated_at: "2026-04-16T04:50:48.729446+00:00"
|
||||
model: "Qwen/Qwen3-Coder-Next-FP8"
|
||||
schema_version: 1
|
||||
sha256: "ea1f4ae58f807074"
|
||||
---
|
||||
|
||||
# ViewModel
|
||||
|
||||
## Documentation: `DiagnosticsViewModel`
|
||||
|
||||
---
|
||||
|
||||
### 1. **Purpose**
|
||||
|
||||
The `DiagnosticsViewModel` class serves as the view model for the Diagnostics module within the application’s UI, implementing the `IDiagnosticsViewModel` interface. It acts as the intermediary between the diagnostics view (`IDiagnosticsTreeView`) and underlying system services (e.g., event aggregation, region management, dependency injection), enabling UI interaction patterns such as notifications and busy-state indication. It subscribes to global events (`RaiseNotification`, `BusyIndicatorChangeNotification`) to synchronize UI state (e.g., `IsBusy`, `IsMenuIncluded`) and trigger interactive popups via Prism’s `InteractionRequest` mechanism. Though currently minimal in logic, it provides the foundational structure for future diagnostics functionality.
|
||||
|
||||
---
|
||||
|
||||
### 2. **Public Interface**
|
||||
|
||||
#### `public IDiagnosticsTreeView View { get; set; }`
|
||||
*Alias:* `TreeView` (see below).
|
||||
The view instance bound to this view model. Set during construction and used to establish data context.
|
||||
|
||||
#### `public IDiagnosticsTreeView TreeView { get; set; }`
|
||||
Explicitly named property (redundant with `View`). Holds the reference to the diagnostics tree view.
|
||||
|
||||
#### `public bool IsDirty { get; private set; }`
|
||||
Read-only property indicating whether the view model’s state has unsaved changes. Currently never set to `true` in the source.
|
||||
|
||||
#### `public bool IsBusy { get; set; }`
|
||||
Public property that reflects whether a long-running operation is in progress. Raises `PropertyChanged` when changed.
|
||||
|
||||
#### `public bool IsMenuIncluded { get; set; }`
|
||||
Controls whether the menu UI element should be rendered. Raises `PropertyChanged` on change.
|
||||
|
||||
#### `public bool IsNavigationIncluded { get; set; }`
|
||||
Controls whether the navigation UI element should be rendered. Raises `PropertyChanged` on change.
|
||||
|
||||
#### `public event PropertyChangedEventHandler PropertyChanged`
|
||||
Standard `INotifyPropertyChanged` implementation. Used by `OnPropertyChanged`.
|
||||
|
||||
#### `public void OnPropertyChanged(string propertyName)`
|
||||
Raises the `PropertyChanged` event for the specified property name.
|
||||
|
||||
#### `public InteractionRequest<Notification> NotificationRequest { get; }`
|
||||
Prism interaction request used to trigger notification popups (e.g., alerts, messages). Raised via `OnRaiseNotification`.
|
||||
|
||||
#### `public InteractionRequest<Confirmation> ConfirmationRequest { get; }`
|
||||
Prism interaction request for confirmation dialogs (currently unused in the source).
|
||||
|
||||
#### `public void Unset()`
|
||||
No-op stub. Intended for cleanup before view model is detached.
|
||||
|
||||
#### `public void Cleanup()`
|
||||
No-op stub. Intended for synchronous cleanup.
|
||||
|
||||
#### `public Task CleanupAsync()`
|
||||
Returns `Task.CompletedTask`. No-op stub for asynchronous cleanup.
|
||||
|
||||
#### `public void Initialize()`
|
||||
No-op stub. Part of Prism’s `INavigationAware` / `IInitialize` pattern.
|
||||
|
||||
#### `public void Initialize(object parameter)`
|
||||
No-op stub.
|
||||
|
||||
#### `public void Initialize(object parameter, object model)`
|
||||
No-op stub.
|
||||
|
||||
#### `public Task InitializeAsync()`
|
||||
Returns `Task.CompletedTask`. No-op stub.
|
||||
|
||||
#### `public Task InitializeAsync(object parameter)`
|
||||
Returns `Task.CompletedTask`. No-op stub.
|
||||
|
||||
#### `public void Activated()`
|
||||
No-op stub. Likely part of Prism’s `INavigationAware` or region lifecycle.
|
||||
|
||||
---
|
||||
|
||||
### 3. **Invariants**
|
||||
|
||||
- `TreeView` must be non-null after construction (set in constructor).
|
||||
- `IsBusy` must be set only via its property setter (which triggers `OnPropertyChanged("IsBusy")`).
|
||||
- `IsMenuIncluded` and `IsNavigationIncluded` must be set only via their property setters (which trigger `OnPropertyChanged`).
|
||||
- `NotificationRequest` and `ConfirmationRequest` are initialized exactly once in the constructor.
|
||||
- Event subscriptions (`RaiseNotification`, `BusyIndicatorChangeNotification`) are established in the constructor and never unsubscribed (potential memory leak risk).
|
||||
- `OnRaiseNotification` constructs a *new* `NotificationContentEventArgs` with empty strings for `Header` and `Footer`, preserving only `Message`, `Image`, and `Title`.
|
||||
|
||||
---
|
||||
|
||||
### 4. **Dependencies**
|
||||
|
||||
#### **Imports / Dependencies Used**
|
||||
- `DTS.Common.Events` → Provides `RaiseNotification`, `BusyIndicatorChangeNotification`, and `NotificationContentEventArgs`.
|
||||
- `DTS.Common.Interface.TestSetups.Diagnostics` → Defines `IDiagnosticsTreeView` and `IDiagnosticsViewModel`.
|
||||
- `Prism.Events` → Provides `IEventAggregator`, `EventAggregator`, and event types.
|
||||
- `Prism.Regions` → Provides `IRegionManager`.
|
||||
- `Unity` → Provides `IUnityContainer`.
|
||||
- `System.ComponentModel`, `System.Threading.Tasks` → Standard .NET interfaces and async support.
|
||||
|
||||
#### **Consumers (Inferred)**
|
||||
- The view (`IDiagnosticsTreeView`) binds to this view model (via `TreeView.DataContext = this`).
|
||||
- External components publish `RaiseNotification` and `BusyIndicatorChangeNotification` events via `IEventAggregator`, which this view model consumes.
|
||||
- Likely registered as a singleton (`[PartCreationPolicy(CreationPolicy.Shared)]`) and injected via Unity.
|
||||
|
||||
---
|
||||
|
||||
### 5. **Gotchas**
|
||||
|
||||
- **No-op lifecycle methods**: All `Initialize*`, `Cleanup*`, and `Activated` methods are empty stubs. Behavior is not implemented despite being part of Prism’s expected patterns.
|
||||
- **Event subscription leak**: Subscriptions to `_eventAggregator.GetEvent<...>().Subscribe(...)` are not disposed or unsubscribed. If the view model is long-lived or recreated frequently, this may cause memory leaks or duplicate handlers.
|
||||
- **Redundant `View` and `TreeView` properties**: Both `View` and `TreeView` are exposed and refer to the same object. This duplication is confusing and suggests possible refactoring debt.
|
||||
- **Unused `ConfirmationRequest`**: Declared but never used. May indicate incomplete implementation.
|
||||
- **`IsDirty` never set to `true`**: The property exists but is never updated, rendering it non-functional.
|
||||
- **`OnRaiseNotification` mutates event args**: A new `NotificationContentEventArgs` is created with empty `Header` and `Footer`, discarding original values. This may be intentional (e.g., to sanitize content), but is not documented.
|
||||
- **No command bindings**: The `#region Commands` section is empty. If commands are expected (e.g., for button clicks), they are not implemented here.
|
||||
|
||||
> **None identified from source alone** for *behavioral correctness* beyond the above.
|
||||
Reference in New Issue
Block a user