Files
DP44/enriched-qwen3-coder-next/Common/DTS.Common.Serialization/Properties.md

83 lines
5.8 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common.Serialization/Properties/AssemblyInfo.cs
- Common/DTS.Common.Serialization/Properties/Settings1.Designer.cs
generated_at: "2026-04-16T03:37:53.704211+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "56e1c9c1d32b363c"
---
# Properties
## Documentation: `DTS.Common.Serialization` Assembly
---
### 1. Purpose
This module provides shared serialization-related infrastructure for the DTS system, primarily encapsulating application settings and metadata for the serialization assembly. Based on the source files, it does **not** contain any serialization logic (e.g., JSON/XML converters, serializers, or deserializers) itself. Instead, it defines a strongly-typed settings class (`Settings1`) for user- and application-scoped configuration values—particularly those related to TDM (Test Data Manager) file paths, default time ranges, and last-used values for TSV export/import UI state—and exposes assembly-level metadata (title, version, COM visibility). Its role is to centralize configuration state and assembly identity, likely consumed by other modules that perform actual data serialization/deserialization.
---
### 2. Public Interface
#### `DTS.Serialization.Properties.Settings1`
A strongly-typed settings class derived from `System.Configuration.ApplicationSettingsBase`. It exposes the following properties:
| Property | Type | Scope | Default Value | Description |
|---------|------|-------|---------------|-------------|
| `TDMFolder` | `string` | User-scoped | `".\\Data\\TDM CFC1000"` | Path to the TDM data folder. |
| `DefaultStart` | `double` | User-scoped | `-500` | Default start time (likely in milliseconds or seconds) for time-range operations. |
| `DefaultStop` | `double` | User-scoped | `500` | Default stop time (aligned with `DefaultStart`). |
| `TSVPOCNameLastUsed` | `string` | User-scoped | `"#NOVALUE"` | Last-used point-of-contact name in TSV export/import workflows. |
| `TSVPOCPhoneAndEmailLastUsed` | `string` | User-scoped | `"#NOVALUE"` | Last-used POC contact info in TSV workflows. |
| `TSVDataTypeLastUsed` | `string` | User-scoped | `"Converted"` | Last-used data type selection (e.g., raw, converted) in TSV workflows. |
| `TSVLabNameLastUsed` | `string` | User-scoped | `"#NOVALUE"` | Last-used lab name in TSV workflows. |
| `TSVTestObjectLastUsed` | `string` | User-scoped | `"#NOVALUE"` | Last-used test object identifier in TSV workflows. |
| `TSVTestTypeLastUsed` | `string` | User-scoped | `"#NOVALUE"` | Last-used test type in TSV workflows. |
| `TableHeader` | `System.Drawing.Color` | Application-scoped | `RGB(215, 225, 255)` | Background color for table headers (read-only). |
| `AlternatingRow` | `System.Drawing.Color` | User-scoped | `RGB(238, 242, 255)` | Background color for alternating table rows. |
- **Static Property**:
`public static Settings1 Default { get; }`
Returns the singleton instance of `Settings1`, thread-safe via `ApplicationSettingsBase.Synchronized`.
> **Note**: No public methods beyond property getters/setters are defined in this assembly. No serialization/deserialization functions are present.
---
### 3. Invariants
- `Settings1.Default` is a singleton: always returns the same instance (synchronized for thread safety).
- `TableHeader` is **read-only** (application-scoped); attempts to set it via `set` will fail at runtime (no setter defined).
- All string settings use `"#NOVALUE"` as a sentinel for "unset" or "no previous value".
- `TDMFolder` defaults to a relative path (`".\\Data\\TDM CFC1000"`), implying the application expects a specific directory structure.
- Time range defaults (`DefaultStart`, `DefaultStop`) are symmetric around zero (`-500` to `500`), suggesting a centered time window (e.g., ±500 ms).
- Settings are persisted per-user (user-scoped) except `TableHeader`, which is per-application.
---
### 4. Dependencies
#### Dependencies *of* this module:
- `System.Configuration` (for `ApplicationSettingsBase`, `UserScopedSettingAttribute`, etc.)
- `System.Drawing` (for `System.Drawing.Color`)
- `System.Runtime.CompilerServices` and `System.CodeDom.Compiler` (for generated-code attributes)
#### Dependencies *on* this module:
- Other modules in the DTS system likely reference this assembly to access `Settings1.Default` for configuration persistence (e.g., UI forms that save/load TSV export options or TDM paths).
- No direct evidence of this module consuming *other* serialization logic—its name (`DTS.Common.Serialization`) may be misleading; it is primarily a settings container.
---
### 5. Gotchas
- **Misleading assembly name**: Despite being named `DTS.Common.Serialization`, this assembly contains **no serialization logic** (no `ISerializer`, `JsonSerializer`, etc.). It is a configuration/settings module.
- **Hardcoded paths**: `TDMFolder` uses a Windows-style relative path (`".\\Data\\TDM CFC1000"`), which may break on non-Windows platforms or if the directory structure changes.
- **Sentinel values**: `"#NOVALUE"` is used as a placeholder for unset string settings. Consumers must explicitly check for this value instead of assuming `null` or `string.Empty`.
- **Color format**: Colors are defined as comma-separated RGB strings in attributes (e.g., `"215, 225, 255"`), but `System.Drawing.Color` parsing is implicit—no validation is visible in this file.
- **Thread safety**: While `Synchronized()` is used, `Settings1` is mutable (most properties have setters). Concurrent writes to user-scoped settings may cause race conditions.
- **Auto-generated file**: `Settings1.Designer.cs` is auto-generated; manual edits will be overwritten. Changes should be made in the designer or via `.settings` files.
- **Versioning**: Assembly version `1.06.0081` suggests a long-lived module; ensure backward compatibility if settings evolve (e.g., new keys added in future versions).
None identified beyond the above.