5.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T11:02:06.405832+00:00 | zai-org/GLM-5-FP8 | 1 | 154eee0c947eb6d0 |
Documentation: DTS.Viewer.PSDReportResults.Resources
1. Purpose
This module provides localization infrastructure for the PSD Report Results viewer component. It consists of a strongly-typed resource accessor class (StringResources) generated from a .resx file, and a XAML markup extension (TranslateExtension) that allows UI elements to bind directly to localized strings declaratively within XAML markup.
2. Public Interface
TranslateExtension
Location: DTS.Viewer.PSDReportResults.Resources.TranslateExtension
Inheritance: System.Windows.Markup.MarkupExtension
A XAML markup extension used to resolve localized strings at runtime.
-
Constructor
public TranslateExtension(string key)Initializes the extension with the resource key to be looked up. The key is stored in a private readonly field
_key. -
Method: ProvideValue
public override object ProvideValue(IServiceProvider serviceProvider)Resolves the localized string for the key provided in the constructor.
- Returns
NotFound("#stringnotfound#") if the_keyis null or empty. - Retrieves the string using
StringResources.ResourceManager.GetString(_key). - Returns
NotFound + " " + _keyif the resource lookup returns null (key not found in resources).
- Returns
StringResources
Location: DTS.Viewer.PSDReportResults.Resources.StringResources
Visibility: internal
A strongly-typed resource class auto-generated by Visual Studio/ResGen. It provides access to localized strings defined in the associated .resx file.
-
Property: ResourceManager
internal static global::System.Resources.ResourceManager ResourceManager { get; }Returns the cached
ResourceManagerinstance for this assembly. It looks up resources named"DTS.Viewer.PSDReportResults.Resources.StringResources". -
Property: Culture
internal static global::System.Globalization.CultureInfo Culture { get; set; }Gets or sets the current
CultureInfofor resource lookups. Overrides the current thread'sCurrentUICulturefor this specific resource class. -
Resource Properties (Static Strings) The following static properties return localized strings:
ChannelName(Lookup key: "ChannelName")ExportPSDHeader(Lookup key: "ExportPSDHeader")ExportPSDtoCSV(Lookup key: "ExportPSDtoCSV")ExportPSDtoPDF(Lookup key: "ExportPSDtoPDF")GRMS(Lookup key: "GRMS")PSDResultsHeader(Lookup key: "PSDResultsHeader")SampleRate(Lookup key: "SampleRate")
3. Invariants
- Auto-generation: The
StringResourcesclass is auto-generated. Manual modifications toStringResources.Designer.cswill be lost upon regeneration. Changes must be made to the underlying.resxfile. - Return Types:
TranslateExtensionis decorated with[MarkupExtensionReturnType(typeof(string))], guaranteeing thatProvideValuereturns a string (or the fallback error string). - Fallback Behavior:
TranslateExtensionwill never returnnull. It guarantees a string return, either the localized value or a specific error constant. - Visibility:
StringResourcesisinternal, restricting access to theDTS.Viewer.PSDReportResultsassembly.
4. Dependencies
- Internal Dependencies:
TranslateExtensiondepends entirely onStringResources.ResourceManagerto perform lookups.
- External Dependencies (Framework):
SystemSystem.Windows.Markup(forMarkupExtensionandIServiceProvider)System.Resources(forResourceManager)System.Globalization(forCultureInfo)System.CodeDom.Compiler(Attributes onStringResources)
5. Gotchas
- Error String Variations: The
TranslateExtensionreturns different error strings depending on the failure mode.- If the input
_keyis null/empty, it returns exactly"#stringnotfound#". - If the lookup fails (key is valid but missing in resources), it returns
"#stringnotfound# " + _key(note the space and the appended key). - Developers parsing or validating these strings must account for this difference.
- If the input
- Designer File Edits: As noted in the auto-generated header, editing
StringResources.Designer.csdirectly is unsafe. The specific resource strings listed (e.g.,ChannelName,GRMS) are the only ones currently defined; adding new ones requires regenerating this file. - Culture Management:
StringResources.Cultureis a static property. Setting it changes the culture for all subsequent lookups within this resource manager, potentially affecting threading behavior if not managed carefully.