4.7 KiB
4.7 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T13:51:30.707906+00:00 | zai-org/GLM-5-FP8 | 1 | ea967aac84c55893 |
Documentation: DTS.Viewer.Graph Resources
1. Purpose
This module provides localization support for the DTS.Viewer.Graph namespace. It consists of a WPF markup extension (TranslateExtension) for declarative XAML binding and an auto-generated resource accessor class (StringResources) for retrieving localized strings programmatically. The module centralizes user-facing strings related to graph operations, data filtering errors, and file export statuses (PDF/CSV).
2. Public Interface
Class: TranslateExtension
Namespace: DTS.Viewer.Graph
Inheritance: System.Windows.Markup.MarkupExtension
This class allows XAML bindings to localized resources.
- Constructor
public TranslateExtension(string key): Initializes the extension with the resource key to look up.
- Method
public override object ProvideValue(IServiceProvider serviceProvider): Returns the localized string associated with_key. If the key is null or empty, it returns the constant#stringnotfound#. If the key is valid but no resource is found, it returns#stringnotfound#appended with the key name.
Class: StringResources
Namespace: DTS.Viewer.Graph.Resources
Visibility: internal
A strongly-typed resource class generated by Visual Studio tools.
- Property:
ResourceManager(static)- Returns the cached
System.Resources.ResourceManagerinstance for this assembly.
- Returns the cached
- Property:
Culture(static)- Gets or sets the
System.Globalization.CultureInfoused for resource lookups.
- Gets or sets the
- Resource String Properties (static, read-only):
BadDataFromCustomFilter: Warning regarding filter class frequency exceeding sample rate bounds.BadDataFromTestSetupDefaultFilter: Warning regarding test filter results causing out-of-bounds data.BadDataUnfilteredUnknown: Error message for unviewable channel data.ReadingChannelData: Status message indicating channel data is being read.SavePDFError: Error message for PDF chart save failure.SavePDFSuccess: Success message for PDF chart save (includes format placeholders{0},{1}, etc.).SaveReportCSVError: Error message for CSV report save failure.SaveReportCSVSuccess: Success message for CSV report save.SaveReportPDFError: Error message for PDF report save failure.SaveReportPDFSuccess: Success message for PDF report save.
3. Invariants
- Null Safety:
TranslateExtension.ProvideValuewill never return null. It guarantees a string return, defaulting to specific error constants if lookup fails. - Error Differentiation: The return value distinguishes between a missing key argument (returns
#stringnotfound#) and a valid key argument with no matching resource (returns#stringnotfound# [key]). - Resource Availability:
StringResourcesassumes the existence of a corresponding.resxfile embedded in the assembly manifest named"DTS.Viewer.Graph.Resources.StringResources".
4. Dependencies
- Internal Dependencies:
TranslateExtensiondepends entirely onDTS.Viewer.Graph.Resources.StringResourcesfor data retrieval.
- External Dependencies:
System: Core base library.System.Windows.Markup: Required forMarkupExtensionandMarkupExtensionReturnTypeAttribute(WPF specific).System.Resources: Used forResourceManager.System.Globalization: Used forCultureInfo.
- Dependents:
- Unknown from source alone. However, the
MarkupExtensionReturnTypeattribute implies consumption by WPF XAML parsers within theDTS.Viewer.Graphmodule.
- Unknown from source alone. However, the
5. Gotchas
- Auto-Generated Code:
StringResourcesis a designer file (StringResources.Designer.cs). Manual edits to this file will be overwritten by the tooling (Visual Studio/ResGen). Changes must be made to the underlying.resxfile. - Internal Visibility: The
StringResourcesclass is markedinternal. It is not accessible outside theDTS.Viewer.Graphassembly. - Silent Failure Mode:
TranslateExtensiondoes not throw exceptions for missing keys. Instead, it returns the literal string#stringnotfound#. Developers debugging missing UI text must search for this specific string or check the output for the appended key name. - Hardcoded Fallback: The fallback string
#stringnotfound#is hardcoded inTranslateExtension.csrather than being localized itself.