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,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`.*