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:
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/Model/TestSummaryModel.cs
generated_at: "2026-04-16T13:55:21.942566+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "eacbbab8741bd493"
---
# Documentation: TestSummaryModel.cs
## 1. Purpose
`TestSummaryModel` is a model class within the `DTS.Viewer.TestSummaryList` module responsible for loading and managing test summary data from `.dts` files. It implements `IBaseModel` and serves as the data access layer between the file system and the `ITestSummaryListViewModel`, handling asynchronous test metadata retrieval, list merging logic, and test selection state management. The class coordinates UI busy states and publishes application-wide events via Prism's `IEventAggregator`.
---
## 2. Public Interface
### Properties
| Name | Type | Description |
|------|------|-------------|
| `Parent` | `ITestSummaryListViewModel` | Reference to the parent ViewModel. Settable property. |
| `_eventAggregator` | `IEventAggregator` | Prism event aggregator for publishing/subscribing to application events. Settable property. |
| `IsSaved` | `bool` | Get-only property. **Note:** Appears unassigned in source (ReSharper suppression present). |
| `PropertyChanged` | `PropertyChangedEventHandler` | Event raised when a property value changes. |
### Methods
#### `void GetTestSummary(string path, string file, bool Include = false, bool selectAll = false)`
Loads test definitions from the specified data folder asynchronously.
- **Parameters:**
- `path` - Directory path to the data folder. Will be created if it doesn't exist.
- `file` - The `.dts` file to load.
- `Include` - When `true` and list has multiple items, selects the first test in the list.
- `selectAll` - When `true`, selects all tests; otherwise uses default selection logic.
- **Behavior:**
- Sets `Parent.IsBusy = true` and publishes `BusyIndicatorChangeNotification(true)`.
- Publishes `AppStatusExEvent` with `AppStatusArg.Busy`.
- Creates the directory at `path` if it doesn't exist.
- Delegates to `TestMetadataList.GetTestSummaryListAsync()` to retrieve test summaries.
- Merges results into `Parent.TestSummaryList`, preserving existing selection state for duplicate tests.
- Calls `DetermineTestsSelected(selectAll)` to apply selection logic.
- Publishes `TestLoadedCountNotification` with loaded count and parent ViewModel reference.
- Publishes `BusyIndicatorChangeNotification(false)` and sets `Parent.IsBusy = false` on completion.
#### `void OnPropertyChanged(string propertyName)`
Raises the `PropertyChanged` event for the specified property name.
---
## 3. Invariants
1. **Directory Creation:** If `path` is non-empty and the directory doesn't exist, it will be created before loading tests.
2. **Test Uniqueness:** Tests are uniquely identified by the combination of `Id`, `SetupName`, and `DataType`. When a duplicate is detected, the existing test is replaced at its original index while preserving its `IsSelected` state.
3. **Selection Guarantees:**
- If `selectAll` is `true`, all tests in `Parent.TestSummaryList` will have `IsSelected = true`.
- If `selectAll` is `false` and the list contains exactly one test, that test is selected.
- If `selectAll` is `false`, the list has multiple tests, and all tests share the same setup name with at least one `DataType == "ALL"`, the first test is selected.
4. **Event Pairing:** `BusyIndicatorChangeNotification` and `AppStatusExEvent` are always published in pairs (busy/available) even in exception scenarios via the `finally` block.
---
## 4. Dependencies
### This Module Depends On:
- `DTS.Common.Classes.Viewer.TestMetadata.TestMetadataList` - Provides `GetTestSummaryListAsync()` method.
- `DTS.Common.Base.IBaseModel` - Interface implemented by this class.
- `DTS.Common.Events` - Event types: `BusyIndicatorChangeNotification`, `AppStatusExEvent`, `TestLoadedCountNotification`.
- `DTS.Common.Interface` - Likely defines `ITestSummaryListViewModel` (inferred).
- `DTS.Viewer.TestSummaryList.ViewModel` - `ITestSummaryListViewModel`, `TestSummaryViewListModel`.
- `Prism.Events.IEventAggregator` - Event aggregation pattern.
- `System.Windows.Threading.Dispatcher` - For async UI dispatching.
### Event Types Referenced:
- `BusyIndicatorChangeNotification` - Payload: `bool`
- `AppStatusExEvent` - Payload: `AppStatusExArg`
- `TestLoadedCountNotification` - Payload: `TestLoadedCountNotificationArg`
- `AppStatusArg` - Enum with `Busy` and `Available` members.
---
## 5. Gotchas
1. **Unassigned Property:** `IsSaved` is a get-only auto-property with no visible assignment. The ReSharper comment `// ReSharper disable UnassignedGetOnlyAutoProperty` indicates this is a known issue. Behavior is undefined.
2. **Naming Convention Violation:** `_eventAggregator` is a public property prefixed with an underscore, which violates typical C# naming conventions for public members.
3. **Nested Try-Catch with Silent Failure:** The inner try-catch block (lines 83-92) silently swallows all exceptions. The comment indicates this was added for a regression build to prevent crashes from a new feature (case 16158).
4. **Async Void Lambda:** The `InvokeAsync` uses an `async` lambda, but the outer method returns `void`. Exception handling is done inside the lambda, but any unhandled exceptions before the first `await` could be problematic.
5. **Collection Event Subscription:** When `Parent.TestSummaryList` is empty, the new list is assigned directly with `CollectionChanged` subscription. When non-empty, items are added individually without apparent `CollectionChanged` subscription on individual items.
6. **Historical Bug Fixes:** Multiple manuscript case references in comments (28164, 35546, 16158) indicate this class has accumulated patches for specific edge cases around test selection and identification logic.

View File

@@ -0,0 +1,37 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/Properties/AssemblyInfo.cs
generated_at: "2026-04-16T13:54:52.641323+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "3de23a946bdde4b4"
---
# Documentation: DTS.Viewer.TestSummaryList Assembly Configuration
## 1. Purpose
This file provides assembly-level metadata and configuration for the `DTS.Viewer.TestSummaryList` module (compiled as `DTS.Viewer.Test`). It defines the assembly's identity, version, and visibility settings using standard .NET attributes. This module exists to encapsulate specific functionality within the larger DTS Viewer application, likely related to displaying lists of test summaries.
## 2. Public Interface
This file does not contain executable classes or methods. It exposes configuration via the following assembly-level attributes:
* **`AssemblyTitle`**: Set to `"DTS.Viewer.Test"`. Provides a friendly name for the assembly.
* **`AssemblyProduct`**: Set to `"DTS.Viewer.Test"`. Specifies the product name this assembly belongs to.
* **`AssemblyVersion`**: Set to `"1.0.0.0"`. Specifies the version of the assembly used by the common language runtime.
* **`AssemblyFileVersion`**: Set to `"1.0.0.0"`. Specifies the file version number displayed on the file properties.
* **`ComVisible`**: Set to `false`. Makes types in this assembly invisible to COM components.
* **`Guid`**: Set to `"b2b2b862-1b93-476a-8246-91e1310c7ec7"`. A unique identifier for the assembly, required if the assembly is ever exposed to COM.
## 3. Invariants
* The assembly version is currently fixed at `1.0.0.0`.
* Types defined within this assembly are not visible to COM components (`ComVisible(false)`).
* The `Guid` attribute value `b2b2b862-1b93-476a-8246-91e1310c7ec7` is constant and uniquely identifies this specific assembly.
## 4. Dependencies
* **Internal Dependencies**: Relies on `System.Reflection`, `System.Runtime.CompilerServices`, and `System.Runtime.InteropServices` for attribute definitions.
* **External Consumers**: This assembly is likely referenced by the main `DTS Viewer` application or other modules requiring test summary list functionality.
## 5. Gotchas
* **Naming Discrepancy**: There is a mismatch between the project directory name (`DTS.Viewer.TestSummaryList`) and the configured assembly name (`DTS.Viewer.Test` via `AssemblyTitle` and `AssemblyProduct`). This could lead to confusion when referencing the assembly or locating the compiled `.dll`/`.exe` file.
* **Stale Metadata**: The `AssemblyCopyright` attribute lists the year 2017. If the codebase is active, this metadata is likely outdated.
* **Missing Description**: The `AssemblyDescription` attribute is an empty string, offering no insight into the module's specific functionality within the assembly properties.

View File

@@ -0,0 +1,116 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/Resources/StringResources.ja.Designer.cs
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/Resources/TranslateExtension.cs
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/Resources/StringResources.Designer.cs
generated_at: "2026-04-16T13:54:20.692720+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "ef8f2f0524698a0d"
---
# Documentation: DTS.Viewer.TestSummaryList.Resources
## 1. Purpose
This module provides localization infrastructure for the TestSummaryList component of the DTS Viewer application. It consists of a strongly-typed resource accessor class (`StringResources`) generated from a .resx file, and a WPF markup extension (`TranslateExtension`) that enables XAML bindings to localized strings. The module supports UI string lookup for test summary list operations including sorting, filtering, and displaying test metadata.
---
## 2. Public Interface
### `TranslateExtension` (WPF Markup Extension)
**Namespace:** `DTS.Viewer.TestSummaryList`
**Class Declaration:**
```csharp
[MarkupExtensionReturnType(typeof(string))]
public class TranslateExtension : MarkupExtension
```
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `TranslateExtension(string key)` | Initializes the extension with the resource key to look up. Stores the key in a private readonly field `_key`. |
| `ProvideValue` | `override object ProvideValue(IServiceProvider serviceProvider)` | Returns the localized string for `_key` from `StringResources.ResourceManager`. Returns `#stringnotfound#` if `_key` is null or empty. Returns `#stringnotfound# <key>` if the key is not found in resources. |
---
### `StringResources` (Auto-generated Resource Class)
**Namespace:** `DTS.Viewer.TestSummaryList.Resources`
**Class Declaration:**
```csharp
[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[DebuggerNonUserCode]
[CompilerGenerated]
internal class StringResources
```
| Property | Return Type | Description |
|----------|-------------|-------------|
| `ResourceManager` | `global::System.Resources.ResourceManager` (static) | Returns the cached ResourceManager instance for this assembly. Lazy-initialized on first access. |
| `Culture` | `global::System.Globalization.CultureInfo` (static) | Gets or sets the current culture for resource lookups. Overrides `CurrentUICulture` for this class. |
**Localized String Properties (all `internal static string`):**
| Property | Default Value (from comments) |
|----------|-------------------------------|
| `Browse` | "Browse..." |
| `ChannelCount` | "Channels: " |
| `Description` | "Description: " |
| `FileDate` | "File Date: " |
| `FileDateAscending` | "File Date" |
| `FileDateDescending` | "File Date (Descending)" |
| `IdAscending` | "Test ID" |
| `IdDescending` | "Test ID (Descending)" |
| `Refresh` | "Refresh" |
| `SetupNameAscending` | "Test Setup" |
| `SetupNameDescending` | "Test Setup (Descending)" |
| `Sort` | "Sort: " |
| `TestID` | "Test ID: " |
| `TestSetup` | "Test Setup: " |
| `TimeStamp` | "TimeStamp: " |
| `TimeStampAscending` | "TimeStamp" |
| `TimeStampDescending` | "TimeStamp (Descending)" |
| `Type` | "Type: " |
---
## 3. Invariants
- **Non-null return guarantee:** `TranslateExtension.ProvideValue` always returns a non-null string, never returns null.
- **Fallback behavior:** Missing or empty keys always produce a string containing `#stringnotfound#`.
- **Key preservation:** When a key is not found in resources, the returned string includes the original key name for debugging purposes.
- **Thread safety:** `StringResources.ResourceManager` uses a lazy-initialization pattern with a local temporary variable, ensuring only one `ResourceManager` instance exists.
- **Auto-generated constraint:** `StringResources` is tool-generated; manual edits will be overwritten on regeneration.
- **Visibility:** `StringResources` is `internal`, restricting access to within the `DTS.Viewer.TestSummaryList` assembly.
---
## 4. Dependencies
### This module depends on:
- `System` - For `ResourceManager`, `CultureInfo`, and base types
- `System.Windows.Markup` - For `MarkupExtension` and `MarkupExtensionReturnTypeAttribute` (WPF infrastructure)
- `System.CodeDom.Compiler` - For `GeneratedCodeAttribute` (auto-generated code marker)
- A `.resx` file (not provided in source) - The source file for `StringResources` string values
### What depends on this module:
- **Inferred:** XAML files within `DTS.Viewer.TestSummaryList` that use `{local:Translate KeyName}` syntax for localized UI strings
- **Inferred:** Code-behind files that reference `StringResources.<PropertyName>` directly
---
## 5. Gotchas
1. **Missing Japanese resource file:** `StringResources.ja.Designer.cs` is empty in the provided source. It is unclear whether this is intentional (placeholder for future localization) or a configuration issue.
2. **Debugging missing keys:** The `NotFound` constant (`#stringnotfound#`) will be visible in the UI if a key is misspelled or missing. This is intentional for debugging but could leak into production if keys are not validated.
3. **Culture not automatically set:** The `StringResources.Culture` property must be explicitly set; there is no automatic synchronization with `Thread.CurrentUICulture` beyond the default `ResourceManager` behavior.
4. **Trailing colons in labels:** Several resource strings (e.g., `ChannelCount`, `Description`, `FileDate`, `TestID`, `TestSetup`, `TimeStamp`, `Type`) include trailing colons and spaces in their default values. Removing these from the .resx could break UI layout assumptions.
5. **No parameter validation in constructor:** `TranslateExtension` accepts any string including whitespace-only strings; only `null` or empty strings trigger the fallback in `ProvideValue`.

View File

@@ -0,0 +1,78 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/View/TestSummaryView.xaml.cs
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/View/TestSummaryListView.xaml.cs
generated_at: "2026-04-16T13:55:15.087802+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a0b85470cc6f6727"
---
# Documentation: DTS.Viewer.TestSummaryList Views
## 1. Purpose
This module provides WPF view components for displaying and interacting with test summary data in the DTS Viewer application. It contains two code-behind classes (`TestSummaryView` and `TestSummaryListView`) that implement `ITestSummaryListView` and serve as the visual presentation layer for test summary lists. The module enables user interaction with test summary items, specifically allowing selection toggling via keyboard input.
---
## 2. Public Interface
### `TestSummaryView` (class)
**Namespace:** `DTS.Viewer.TestSummaryList`
**Implements:** `ITestSummaryListView`
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `public TestSummaryView()` | Initializes the view by calling `InitializeComponent()`. |
---
### `TestSummaryListView` (class)
**Namespace:** `DTS.Viewer.TestSummaryList`
**Implements:** `ITestSummaryListView`
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `public TestSummaryListView()` | Initializes the view by calling `InitializeComponent()`. |
| `TestSummary_KeyUp` | `private void TestSummary_KeyUp(object sender, KeyEventArgs e)` | Event handler that toggles the `IsSelected` property on a `TestSummary` object when the Space key is released, provided the sender is a `ListView` with a `TestSummary` item selected. |
---
## 3. Invariants
- Both view classes implement `ITestSummaryListView` interface from `DTS.Common.Interface`.
- `TestSummary_KeyUp` handler only processes keyboard events when:
- The `sender` can be cast to a `ListView`
- The `ListView.SelectedItem` can be cast to a `TestSummary` type
- When the Space key is pressed on a valid `TestSummary` item, `e.Handled` is set to `true`; otherwise, it is set to `false`.
- The `IsSelected` property on `TestSummary` is toggled (negated) on Space key release.
---
## 4. Dependencies
### This module depends on:
| Dependency | Usage |
|------------|-------|
| `DTS.Common.Interface` | Provides `ITestSummaryListView` interface |
| `DTS.Common.Classes.Viewer.TestMetadata` | Provides `TestSummary` class |
| `DTS.Common.Interface.TestDefinition` | Imported but **not visibly used** in the provided source |
| `System.Windows` | WPF framework (`FrameworkElement`, `UIElement`) |
| `System.Windows.Controls` | Provides `ListView` control |
| `System.Windows.Input` | Provides `KeyEventArgs`, `Key` enum |
### What depends on this module:
- **Unclear from source alone** — consumers of `ITestSummaryListView` implementations are not visible in the provided files.
---
## 5. Gotchas
1. **Two similarly-named classes exist:** Both `TestSummaryView` and `TestSummaryListView` implement the same interface (`ITestSummaryListView`) within the same namespace. The relationship and distinction between these two views is unclear from the source alone.
2. **Namespace suppression directive:** The file `TestSummaryListView.xaml.cs` contains `// ReSharper disable CheckNamespace`, suggesting a mismatch between the file location and the declared namespace. This may indicate the file was moved or the namespace was renamed without relocating the file.
3. **Unused import:** The namespace `DTS.Common.Interface.TestDefinition` is imported in `TestSummaryListView.xaml.cs` but no types from it are referenced in the visible code. This may be dead code or used in the XAML portion not shown.
4. **XAML partial not shown:** Both classes are `partial` and depend on XAML-generated code via `InitializeComponent()`. The actual UI layout, bindings, and event wire-up (e.g., how `TestSummary_KeyUp` is connected) are defined in the corresponding `.xaml` files, which are not provided.

View File

@@ -0,0 +1,183 @@
---
source_files:
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/ViewModel/TestSummaryViewModel.cs
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.TestSummaryList/ViewModel/TestSummaryViewListModel.cs
generated_at: "2026-04-16T13:54:46.702068+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "b27cef2360f72751"
---
# Documentation: TestSummaryList ViewModels
## 1. Purpose
This module provides two ViewModel implementations (`TestSummaryViewModel` and `TestSummaryViewListModel`) for managing and displaying test summary data within the DTS Viewer application. Both classes implement `ITestSummaryListViewModel` and serve as intermediaries between test summary data models and their associated views, handling user interactions, event-based communication via Prism's EventAggregator, and data binding for test summary lists. The module supports filtering, sorting, selection tracking, and notification of changes to other application components.
---
## 2. Public Interface
### TestSummaryViewModel
**Constructor:**
```csharp
public TestSummaryViewModel(ITestSummaryListView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
```
Initializes the ViewModel, sets the View's DataContext, creates interaction requests, and subscribes to `RaiseNotification` and `DataFolderChangedEvent` events.
**Methods:**
| Method | Signature | Description |
|--------|-----------|-------------|
| `Initialize` | `void Initialize()` | Empty override. |
| `Initialize` | `void Initialize(object parameter)` | Casts `parameter` to `IBaseWindowModel` and assigns to `Parent`. |
| `Activated` | `void Activated()` | Throws `NotImplementedException`. |
| `Cleanup` | `void Cleanup()` | Throws `NotImplementedException`. |
| `CleanupAsync` | `Task CleanupAsync()` | Throws `NotImplementedException`. |
| `InitializeAsync` | `Task InitializeAsync()` | Throws `NotImplementedException`. |
| `InitializeAsync` | `Task InitializeAsync(object parameter)` | Throws `NotImplementedException`. |
| `PublishSelectedTestSummaryList` | `void PublishSelectedTestSummaryList()` | Publishes `TestSummaryChangeNotification` and `TestSelectedChangedEvent` events with current selection. |
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `TestSummaryListView` | `ITestSummaryListView` | The associated view instance. |
| `NotificationRequest` | `InteractionRequest<Notification>` | Prism interaction request for notifications. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Prism interaction request for confirmations. |
| `ContextNavigationRegion` | `object` | Gets/sets content of `TestListRegion` on the view. |
| `SelectedTestSummary` | `TestSummary` | Currently selected test summary. |
| `SelectedTestSummaryList` | `List<ITestSummary>` | List of selected test summaries. |
| `TestSummaryList` | `ObservableCollection<ITestSummary>` | Collection of all test summaries. |
| `HeaderInfo` | `string` | Returns `"TestSummaryRegion"`. |
| `IsBusy` | `bool` | Busy indicator state. |
| `IsDirty` | `bool` | Dirty state flag. |
| `IsNavigationIncluded` | `bool` | Navigation inclusion flag. |
---
### TestSummaryViewListModel
**Constructor:**
```csharp
public TestSummaryViewListModel(ITestSummaryListView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
```
Initializes the ViewModel, sets the View's DataContext, creates interaction requests, and stores dependencies.
**Methods:**
| Method | Signature | Description |
|--------|-----------|-------------|
| `Initialize` | `void Initialize()` | Empty override. |
| `Initialize` | `void Initialize(object parameter)` | Sets `Parent`, initializes `FilterView`, attaches collection changed handlers, calls `Subscribe()`. |
| `Activated` | `void Activated()` | Publishes `FilterParameterChangedEvent` with empty parameter. |
| `Cleanup` | `void Cleanup()` | Clears all test summary collections, resets `SelectedTestSummary`, calls `PublishSelectedTestSummaryList()`. |
| `PublishSelectedTestSummaryList` | `void PublishSelectedTestSummaryList()` | Publishes `TestSummaryChangeNotification`, `TestSummaryCountNotification`, and `ResetZoomChangedEvent` events. |
| `OnFilterChanged` | `void OnFilterChanged(FilterParameterArgs args)` | Filters `FilteredTestSummaryList` based on `args.Param` matching `SetupName`, `Id`, or `Description`. |
| `RefreshDataFolder` | `void RefreshDataFolder()` | Publishes `DataFolderChangedEvent` via dispatcher. |
| `SelectDataFolder` | `void SelectDataFolder()` | Opens file dialog for `.dts` files, publishes `DataFileSelectedEvent` on selection. |
**Properties:**
| Property | Type | Description |
|----------|------|-------------|
| `FilterView` | `IFilterView` | Filter view instance. |
| `View` | `ITestSummaryListView` | The associated view instance. |
| `NotificationRequest` | `InteractionRequest<Notification>` | Prism interaction request for notifications. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | Prism interaction request for confirmations. |
| `ContextNavigationRegion` | `object` | Gets/sets DataContext of `TestListRegion` on the view. |
| `IsFilterEnabled` | `bool` | Indicates if filtering is available (true when `TestSummaryList` has items). |
| `SelectedTestSummary` | `TestSummary` | Currently selected test summary. |
| `SelectedTestSummaryList` | `List<ITestSummary>` | List of selected test summaries. |
| `TestSummaryList` | `ObservableCollection<ITestSummary>` | Full collection of test summaries. |
| `FilteredTestSummaryList` | `ObservableCollection<ITestSummary>` | Filtered/sorted view of test summaries. |
| `HeaderInfo` | `string` | Returns `"TestSummaryRegion"`. |
| `IsBusy` | `bool` | Busy indicator state. |
| `IsDirty` | `bool` | Dirty state flag. |
| `IsNavigationIncluded` | `bool` | Navigation inclusion flag. |
| `SelectedDataFolder` | `string` | Selected data folder path; setter publishes `DataFolderChangedEvent`. |
| `SelectedDataFile` | `string` | Selected data file path; setter publishes `DataFolderChangedEvent`. |
| `SortableAttributes` | `List<string>` | List of localized sortable attribute names. |
| `SelectedSortIndex` | `int` | Index of selected sort option; setter triggers `SortTestSummaryList()`. |
**Commands:**
| Command | Type | Description |
|---------|------|-------------|
| `RefreshDataFolderCommand` | `DelegateCommand` | Executes `RefreshDataFolder()`. |
| `SelectDataFolderCommand` | `DelegateCommand` | Executes `SelectDataFolder()`. |
**Nested Types:**
| Type | Description |
|------|-------------|
| `SortableAttribute` (enum) | Sort options: `TimeStampDescending`, `Timestamp`, `FileDateDescending`, `FileDate`, `IdDescending`, `Id`, `TestSetupDescending`, `TestSetup`. |
| `SortableAttributeHelper` | Helper class for localizing sort attribute display names via `StringResources`. |
---
## 3. Invariants
- **Parent Assignment:** `Initialize(object parameter)` in both classes expects `parameter` to be castable to `IBaseWindowModel` (TestSummaryViewModel) or `IBaseViewModel` (TestSummaryViewListModel); a null or incorrect type will cause an invalid cast exception.
- **Event Subscription Timing:** Event subscriptions occur in the constructor (TestSummaryViewModel) or in `Initialize` via `Subscribe()` (TestSummaryViewListModel); events published before initialization may not be received.
- **Collection Synchronization:** In `TestSummaryViewListModel`, `FilteredTestSummaryList` is automatically synchronized with `TestSummaryList` via `TestSummaryList_CollectionChanged` handler.
- **Filter Ownership:** `OnFilterChanged` only applies filtering when `FilterView.DataContext.Parent` equals `this`.
- **Data Folder Event Handling:** `OnDataFolderChanged` in `TestSummaryViewListModel` only processes events where `arg.ParentVM` matches `Parent`.
- **Property Setters with Side Effects:** `SelectedDataFolder` and `SelectedDataFile` setters publish events; setting to null or empty string returns early without publishing.
- **Sort Index Default:** `SelectedSortIndex` defaults to `(int)SortableAttribute.TimeStampDescending` (value 0).
---
## 4. Dependencies
### External Dependencies (from imports):
| Namespace | Purpose |
|-----------|---------|
| `DTS.Common.Base` | `BaseViewModel<T>` base class. |
| `DTS.Common.Classes.TestMetadata` / `DTS.Common.Classes.Viewer.TestMetadata` | `TestSummary`, `ITestSummary` interfaces. |
| `DTS.Common.Events` | Event types: `RaiseNotification`, `DataFolderChangedEvent`, `ShowStatus`, `TestSummaryChangeNotification`, `TestSelectedChangedEvent`, `FilterParameterChangedEvent`, `RefreshTestRequestEvent`, `BusyIndicatorChangeNotification`, `TestSummaryCountNotification`, `ResetZoomChangedEvent`, `DataFileSelectedEvent`. |
| `DTS.Common.Interface` | `IBaseWindowModel`, `IBaseViewModel`, `IEventAggregator` usage patterns. |
| `DTS.Common.Interface.TestDefinition` | `ITestSummaryListViewModel`, `ITestSummaryListView`. |
| `DTS.Common.Interactivity` | `NotificationContentEventArgs`. |
| `DTS.Viewer.TestSummaryList.Model` | `TestSummaryModel` for data loading. |
| `DTS.Viewer.TestSummaryList.Resources` | `StringResources` for localization. |
| `Microsoft.Practices.Prism.Events` / `Prism.Events` | `EventAggregator` pattern. |
| `Microsoft.Practices.Prism.Interactivity.InteractionRequest` / `Prism.Interactivity` | `InteractionRequest<T>`, `Notification`, `Confirmation`. |
| `Microsoft.Practices.Prism.Regions` / `Prism.Regions` | `IRegionManager`, region-based navigation. |
| `Microsoft.Practices.Unity` / `Unity` | `IUnityContainer` for dependency injection. |
| `Prism.Commands` | `DelegateCommand`. |
| `System.Windows.Forms` | `OpenFileDialog` for file selection. |
### Internal Dependencies:
- **TestSummaryModel:** Both ViewModels instantiate `TestSummaryModel` to call `GetTestSummary()` for loading data.
- **IFilterView / IFilterViewModel:** `TestSummaryViewListModel` resolves these via Unity container.
### Consumers (inferred):
- Views: `TestSummaryView` (referenced in `TestSummaryViewModel.ContextNavigationRegion`), `TestSummaryListView` (referenced in `TestSummaryViewListModel.ContextNavigationRegion`).
- Any module subscribing to `TestSummaryChangeNotification`, `TestSummaryCountNotification`, `TestSelectedChangedEvent`, or `ResetZoomChangedEvent`.
---
## 5. Gotchas
### Critical Issues:
1. **NotImplementedException Methods in TestSummaryViewModel:** The following methods throw `NotImplementedException`: `Activated()`, `Cleanup()`, `CleanupAsync()`, `InitializeAsync()`, and `InitializeAsync(object parameter)`. Calling these will crash the application.
2. **Misleading XML Documentation:** The constructor XML comment in `TestSummaryViewModel` states "Creates a new instance of the TechnologyDoFrontEditViewModel" — this appears to be a copy-paste error from another class.
3. **Event Signature Mismatch:** `TestSummaryViewModel.OnDataFolderChanged(string path)` expects a `string` parameter, while `TestSummaryViewListModel.OnDataFolderChanged(DataFolderSelectionArg arg)` expects `DataFolderSelectionArg`. The event `DataFolderChangedEvent` is subscribed by both with incompatible signatures — unclear which signature the event actually uses.
4. **new Keyword Shadowing:** Both classes use `new` keyword on `PropertyChanged`, `OnPropertyChanged`, `IsBusy`, `IsDirty`, and `IsNavigationIncluded`. This suggests the base class `BaseViewModel<T>` already defines these members, and the shadowing may cause unexpected behavior when casting to base type.
5. **Direct View Casting:** `ContextNavigationRegion` property directly casts the view interface to concrete types (`TestSummaryView` or `TestSummaryListView`), breaking the interface abstraction pattern.
6. **Dispatcher Usage in RefreshDataFolder:** `RefreshDataFolder()` uses `Dispatcher.CurrentDispatcher.Invoke()` with `DispatcherPriority.Background`, which may cause timing issues if called from a non-UI thread.
7. **Sort Implementation Rebuilds Collection:** `SortTestSummaryList()` clears and rebuilds `FilteredTestSummaryList` on every sort change, which may cause UI flicker and performance issues with large datasets.
8. **Missing Unsubscribe:** Neither class unsubscribes from events in cleanup, potentially causing memory leaks if instances are not properly garbage collected.