14 KiB
14 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:14:42.933303+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 1aa96c65b3ed084a |
Documentation: DTS.Common.Controls Module
1. Purpose
This module provides a collection of reusable WPF UI controls and supporting types for the DTS (presumably "Data Test System") application. Its primary role is to encapsulate common UI patterns—such as test ID generation, lookup selection, dynamic grid layout, and enhanced GridView column headers with filtering/searching capabilities—into self-contained, declarative components. These controls reduce duplication across UI layers and enforce consistent behavior for test configuration, data display, and user interaction. The module does not contain business logic but serves as a bridge between XAML UI definitions and underlying data/event infrastructure (e.g., Prism EventAggregator, ServiceLocator).
2. Public Interface
Classes
RoundedBox : UserControl
public void Connect(int connectionId, object target)
Stub method intended for connection management; currently throwsNotImplementedException. Not functional.
TestIDView : UserControl
public TestIDView()
Constructor; initializes component viaInitializeComponent(). No additional public members exposed.
checkbox : UserControl
public void ToolTipEventHandler(object sender, ToolTipEventArgs e)
HandlesToolTipevents by publishing aHelpTextEventviaIEventAggregator, including thesenderandein aHelpTextEventArg.
GridLengthAnimation : AnimationTimeline
public GridLength From { get; set; }
StartingGridLengthfor the animation.public GridLength To { get; set; }
EndingGridLengthfor the animation.public override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
Computes interpolatedGridLengthbased onanimationClock.CurrentProgress. Handles bothPixelandStarunit types. AssumesFromandToare non-null and valid.
ISOPopup : Popup
public ISOPopup()
Constructor; initializes component viaInitializeComponent().private void ISOPart_OnPreviewKeyUp(object sender, KeyEventArgs e)
Filters keyboard input: only allows alphanumeric keys, numeric keypad digits, control keys (Enter, Tab, Backspace, etc.), andOemQuestion(?). Setse.Handled = truefor disallowed keys.private void ISOPart_OnGotMouseCapture(object sender, MouseEventArgs e)
Ifsenderis aTextBox, selects all text (tb.SelectAll()).private void ISOPart_OnGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
Same behavior asISOPart_OnGotMouseCapture.
LookupPopup : Popup
public IEnumerable<IChannelCode> AllChannelCodes { get; private set; }
Property for channel codes (not used in current implementation).public event ChannelCodeSelectedEventHandler ChannelCodeSelected
Event raised when a channel code is selected via double-click in theDataGrid.public IList PossibleChannels { get; set; }
DP-backed property; default value is an empty list of anonymous objects withCodeandNameproperties.private void PossibleChannels_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
RaisesChannelCodeSelectedwithCodeandNameextracted via reflection from the selectedDataGriditem.
TestIdPreFixSuffixHelper : Base.BasePropertyChanged
public TestIdPreFixSuffix TestIdPreFixSuffix { get; }
Holds the underlying prefix/suffix configuration.public override string ToString()
Returns localized string viaStrings.Strings.ResourceManager.GetString(...), or fallback to internal string if not found.public override bool Equals(object obj)
ComparesTestIdPreFixSuffix.FixedValue; forNotFixed, also compares string representation.
TestIdPreFixSuffix
public TestIdFixedPrefixSuffixValues FixedValue { get; }
Enum value indicating fixed prefix/suffix type.public TestIdPreFixSuffix(TestIdFixedPrefixSuffixValues fixedPrefixSuffix)
Constructor for enum-based initialization.public TestIdPreFixSuffix(string dbPrefixSuffix)
Constructor for arbitrary string-based initialization.public override string ToString()
Returns internal_tempString(e.g.,"TESTID_PREFIX_SUFFIX_1"forTimeStamp).
enum TestIdFixedPrefixSuffixValues
NotFixed = -1,None = 0,TimeStamp = 1,TestSetupName = 2
TestIDViewModel : INotifyPropertyChanged
public string TestSetupLabel { get; set; }
DP-backed property; raisingTestSetupLabelVisibilitychange on update.public Visibility TestSetupLabelVisibility { get; }
Computed property:CollapsedifTestSetupLabelis null/empty, elseVisible.public string TestIdEditableText { get; set; }
Editable test ID component.public void PopulateAllTestIdPrefixSuffixValues(string[] serializedValues)
Populates_allTestIdPrefixSuffixValueswith built-in items (None,TimeStamp,TestSetupName) and DB-provided values.public TestIdPreFixSuffixHelper[] AllTestIdPrefixSuffixValues { get; }
Read-only array of available prefix/suffix helpers.public TestIdPreFixSuffixHelper SelectedTestIdPrefixValueItem { get; set; }
Selected prefix helper (default:None).public TestIdPreFixSuffixHelper SelectedTestIdSuffixValueItem { get; set; }
Selected suffix helper (default:TimeStamp).public string TestName { get; set; }
Used forTestSetupNameprefix/suffix.public string GetTestId()
Constructs test ID by concatenating prefix,TestSetupLabel,TestIdEditableText, and suffix with_separator.private string GetRunTimeTestIdPrefixOrSuffix(TestIdPreFixSuffixHelper prefixOrSuffix)
Returns runtime value:TestNameforTestSetupName, timestamp forTimeStamp, or string representation forNotFixed.public string GetTestIdTimestamp()
Returns formatted timestamp:"yyyy_MM_dd HH_mm".
TestIdControl : UserControl, INotifyPropertyChanged
- Identical public interface to
TestIDViewModel(same properties, methods, and behavior).
Note: Code comments indicate this control is deprecated and should be removed after TTS migration.
GridViewColumnHeaderSelectable : UserControl, IBasePropertyChanged
public string ListviewId { get; set; }
DP-backed; used to correlate withListViewStatusEvent.public string HeaderTitle { get; set; }
DP-backed; default"Awesome".public bool ToggleButtonIsChecked { get; set; }
Controls popup state; raisesOpenChangedevent andToggleIconGeometrychange.public Geometry ToggleIconGeometry { get; }
Computed based onHeaderSearchTerm(not implemented—usesdtsGridViewColumnHeader.FindResource(...)).public event RoutedEventHandler OpenChanged
Raised when popup state changes.public event RoutedEventHandler ClickHandler
Raised on header click (viaPreviewLeftButtonUp).public event RoutedEventHandler SelectAll
Raised on "Select All"/"Clear All" button clicks.
GridViewColumnHeaderSearchable : UserControl, IBasePropertyChanged
public string ListviewId { get; set; }
DP-backed; used to correlate withListViewStatusEvent.public string HeaderTitle { get; set; }
DP-backed; default"Awesome".public bool ToggleButtonIsChecked { get; set; }
Controls popup state; raisesOpenChangedevent andToggleIconGeometrychange.public string HeaderSearchTerm { get; set; }
DP-backed; default"". RaisesSearchevent on change.public Geometry ToggleIconGeometry { get; }
Computed based onHeaderSearchTerm(usesdtsGridViewColumnHeader.FindResource(...)).public event RoutedEventHandler OpenChanged
Raised when popup state changes.public event RoutedEventHandler ClickHandler
Raised on header click (suppresses click if insidePopup).public event RoutedEventHandler Search
Raised whenHeaderSearchTermchanges or Enter key pressed.
BoolToInvertedBoolConverter : IValueConverter
public object Convert(object value, ...)
Convertsboolto invertedbool.public object ConvertBack(...)
ThrowsNotImplementedException.
GridViewColumnHeaderSearchableCheckBox : UserControl, IBasePropertyChanged
public string ListviewId { get; set; }
DP-backed; used to correlate withListViewStatusEvent.public string HeaderTitle { get; set; }
DP-backed; default"Awesome".public bool ToggleButtonIsChecked { get; set; }
Controls popup state; raisesOpenChangedevent andToggleIconGeometrychange.public string HeaderSearchTerm { get; set; }
DP-backed; default"". RaisesSearchevent on change.public Geometry ToggleIconGeometry { get; }
Computed based onHeaderSearchTerm(usesdtsGridViewColumnHeader.FindResource(...)).public event RoutedEventHandler OpenChanged
Raised when popup state changes.public event RoutedEventHandler ClickHandler
Raised on header click.public event RoutedEventHandler Search
Raised whenHeaderSearchTermchanges (namedSearchCheckBoxin event registration).public event RoutedEventHandler Filter
Raised on "All"/"True"/"False" button clicks.
AutoSizedGridView : GridView
protected override void PrepareItem(ListViewItem item)
Ensures columns with"Auto"width are measured correctly by forcing remeasurement. Preserves bound column bindings.
DynamicGrid : Grid, INotifyPropertyChanged
public byte GridColumns { get; set; }
Number of columns; triggersRefresh()on change.public void Refresh()
Dynamically rebuildsColumnDefinitionsandRowDefinitionsto fit children in a left-to-right, top-to-bottom flow. Last column is*(star), others areAuto. Adds a final*row.protected override void OnVisualChildrenChanged(...)
CallsRefresh()on child addition/removal.
3. Invariants
GridLengthAnimation.GetCurrentValueassumesFromandToare non-null and theirValueproperties are finite. No validation is performed.TestIdPreFixSuffixHelper.ToString()relies onStrings.Strings.ResourceManagerexisting and containing keys matchingTestIdPreFixSuffix.ToString()output. Falls back to internal string if not found.LookupPopup.PossibleChannelsmust contain objects withCodeandNameproperties (via reflection); no compile-time or runtime validation.ISOPopupkey filtering is strict: only allows specific keys (alphanumeric, numeric keypad, control keys,?). Other keys are rejected (e.Handled = true).DynamicGrid.Refresh()assumesChildrencontains onlyUIElements; no type checking.TestIdControlandTestIDViewModelshare identical logic but are separate implementations (tech debt).GridViewColumnHeader*controls depend ondtsGridViewColumnHeaderresource dictionary containing"DownArrowIconGeometry"and"FilterIconGeometry"resources.
4. Dependencies
External Dependencies
- WPF Framework:
System.Windows,System.Windows.Controls,System.Windows.Media.Animation, etc. - Prism Library:
Microsoft.Practices.Prism.Events(IEventAggregator,EventBase). - Enterprise Library:
Microsoft.Practices.ServiceLocation(ServiceLocator). - DTS Common Core:
DTS.Common.Base.IBasePropertyChangedDTS.Common.Events.*(HelpTextEvent,ListViewStatusEvent)DTS.Common.Interface.Channels.ChannelCodes.IChannelCodeDTS.Common.Utilities.Logging.*DTS.Common.Strings(forStrings.Strings.ResourceManager)
Internal Dependencies
- Controls:
TestIDViewModelandTestIdControlshare logic but are not interdependent.GridViewColumnHeader*controls depend on shared XAML resources (dtsGridViewColumnHeader).
- Data Models:
TestIdPreFixSuffixandTestIdPreFixSuffixHelperare tightly coupled.AutoSizedGridViewdepends onGridViewColumnmetadata (Width, bindings).
5. Gotchas
RoundedBox.Connectis unimplemented and will throwNotImplementedExceptionif called.LookupPopup.PossibleChannelsuses reflection (item.GetType().GetProperty(...)) to extractCode/Name. Fails silently if properties are missing or inaccessible (returnsnull).TestIdControlis deprecated (comment: "Remove this control after deleting the TTS module..."). PreferTestIDViewModel.GridViewColumnHeader*controls assumedtsGridViewColumnHeaderresource dictionary exists and contains required geometries. Missing resources cause runtime exceptions.BoolToInvertedBoolConverter.ConvertBackis unimplemented—throwsNotImplementedException.DynamicGrid.Refresh()adds a final*row regardless of content, which may cause unexpected spacing.GridLengthAnimationdoes not handleNaNor negativeGridLength.Value—may produce invalid interpolated values.ISOPopupkey filtering is overly restrictive (e.g., no spaces, punctuation beyond?), potentially limiting user input.TestIDViewModelandTestIdControlduplicate logic—changes must be applied in both places.AutoSizedGridViewusesGetHashCode()for column tracking—not robust if columns are reused or recreated (hash collisions possible).