5.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T13:54:20.692720+00:00 | zai-org/GLM-5-FP8 | 1 | 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:
[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:
[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.ProvideValuealways 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.ResourceManageruses a lazy-initialization pattern with a local temporary variable, ensuring only oneResourceManagerinstance exists. - Auto-generated constraint:
StringResourcesis tool-generated; manual edits will be overwritten on regeneration. - Visibility:
StringResourcesisinternal, restricting access to within theDTS.Viewer.TestSummaryListassembly.
4. Dependencies
This module depends on:
System- ForResourceManager,CultureInfo, and base typesSystem.Windows.Markup- ForMarkupExtensionandMarkupExtensionReturnTypeAttribute(WPF infrastructure)System.CodeDom.Compiler- ForGeneratedCodeAttribute(auto-generated code marker)- A
.resxfile (not provided in source) - The source file forStringResourcesstring values
What depends on this module:
- Inferred: XAML files within
DTS.Viewer.TestSummaryListthat use{local:Translate KeyName}syntax for localized UI strings - Inferred: Code-behind files that reference
StringResources.<PropertyName>directly
5. Gotchas
-
Missing Japanese resource file:
StringResources.ja.Designer.csis empty in the provided source. It is unclear whether this is intentional (placeholder for future localization) or a configuration issue. -
Debugging missing keys: The
NotFoundconstant (#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. -
Culture not automatically set: The
StringResources.Cultureproperty must be explicitly set; there is no automatic synchronization withThread.CurrentUICulturebeyond the defaultResourceManagerbehavior. -
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. -
No parameter validation in constructor:
TranslateExtensionaccepts any string including whitespace-only strings; onlynullor empty strings trigger the fallback inProvideValue.