4.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-17T15:41:10.196599+00:00 | zai-org/GLM-5-FP8 | 1 | 423da40d53f139d7 |
Documentation: CommonStyles (Auto-Generated)
1. Purpose
This module contains the auto-generated code-behind for CommonStyles.xaml, a WPF ResourceDictionary that defines centralized visual styles for the DTS.Common assembly. The generated class facilitates XAML parsing and connects event handlers—specifically ToolTipOpeningEvent handlers—to various styles defined in the XAML. This is build output from PresentationBuildTasks and should not be manually edited.
2. Public Interface
Class: DTS.Common.CommonStyles
A partial class extending System.Windows.ResourceDictionary that implements System.Windows.Markup.IComponentConnector and System.Windows.Markup.IStyleConnector.
public void InitializeComponent()
Initializes the resource dictionary by loading the XAML component. Idempotent—subsequent calls return immediately if already loaded. Loads the resource at URI /DTS.Common;component/themes/commonstyles.xaml via System.Windows.Application.LoadComponent().
void IComponentConnector.Connect(int connectionId, object target)
Explicit interface implementation. Sets _contentLoaded = true. No other behavior observed in the generated code.
void IStyleConnector.Connect(int connectionId, object target)
Explicit interface implementation. Connects System.Windows.EventSetter instances to styles based on connectionId. Creates EventSetter objects with:
- Event:
System.Windows.FrameworkElement.ToolTipOpeningEvent - Handler: A new
System.Windows.Controls.ToolTipEventHandlerwrappingthis.ToolTipEventHandler
The handler is attached to 12 distinct styles (connection IDs 1–12), corresponding to XAML lines 39, 54, 703, 727, 771, 941, 996, 1050, 1659, 1826, 1912, and 1929 in CommonStyles.xaml.
private bool _contentLoaded
Tracks whether InitializeComponent() has been called.
3. Invariants
- Idempotent Initialization:
InitializeComponent()may be called multiple times safely; it will only execute once. - Fixed Resource URI: The XAML resource location is hardcoded as
/DTS.Common;component/themes/commonstyles.xamlwithUriKind.Relative. - Partial Class Contract: The
ToolTipEventHandlermethod referenced inIStyleConnector.Connect()must be defined in the non-generated portion of this partial class (not shown in provided source). - Connection ID Range: Valid
connectionIdvalues forIStyleConnector.Connectare 1–12 inclusive.
4. Dependencies
This Module Depends On:
System.Windows.ResourceDictionarySystem.Windows.Markup.IComponentConnectorSystem.Windows.Markup.IStyleConnectorSystem.Windows.ApplicationSystem.Windows.EventSetterSystem.Windows.FrameworkElementSystem.Windows.Controls.ToolTipEventHandlerMicrosoft.Windows.Controls(imported but usage not visible in generated code)- Extensive WPF namespaces:
System.Windows.Controls,System.Windows.Media,System.Windows.Shapes, etc.
Build-Time Dependencies:
PresentationBuildTasksversion 4.0.0.0 (code generator)
What Depends On This:
- Unclear from source alone. The
CommonStyles.xamlresource dictionary is presumably merged into application-level or window-level resources, but consumers are not visible in this generated file.
5. Gotchas
- Auto-Generated Code: Both provided files are build outputs (
.g.i.csand.g.cs). Manual changes will be overwritten on rebuild. The actual implementation logic resides inCommonStyles.xamland any accompanying hand-written code-behind. - Missing Partial Class Definition: The
ToolTipEventHandlermethod is referenced but not defined in the provided source. It must exist in the non-generated partial class file (likelyCommonStyles.xaml.cs). - Duplicate Files: The two provided files (
CommonStyles.g.i.csandCommonStyles.g.cs) are functionally identical. This duplication may result from different build configurations or intermediate output paths. - XAML Not Provided: The actual style definitions, target types, and visual templates are in
CommonStyles.xaml, which is not included. The generated code only reveals that 12 styles subscribe toToolTipOpeningEvent. - Checksum Verification: The pragma checksum directive references the original XAML file for integrity verification during builds.