15 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T12:02:29.779799+00:00 | zai-org/GLM-5-FP8 | 1 | 1aa96c65b3ed084a |
DTS.Common.Controls Documentation
1. Purpose
This module provides a collection of custom WPF controls and helpers for the DTS application. It includes specialized controls for test ID generation and display, animated grid layouts, popup-based lookup and ISO input validation, and enhanced GridView column headers with search, selection, and filtering capabilities. The controls integrate with the Prism EventAggregator for cross-component communication and support data binding through dependency properties and INotifyPropertyChanged.
2. Public Interface
RoundedBox
public partial class RoundedBox : UserControl
public RoundedBox() // Constructor
public void Connect(int connectionId, object target) // Stub method (implementation commented out)
A simple UserControl. The Connect method is defined but its implementation is commented out.
TestIDView
public partial class TestIDView : UserControl
public TestIDView() // Constructor
A simple UserControl with no additional public members beyond the constructor.
checkbox
public partial class checkbox
public void ToolTipEventHandler(object sender, ToolTipEventArgs e)
Handles tooltip events by publishing a HelpTextEvent via the IEventAggregator. Sets e.Handled = true and forwards the event arguments to subscribers.
GridLengthAnimation
public class GridLengthAnimation : AnimationTimeline
public GridLengthAnimation() // Constructor
public GridLength From { get; set; } // Dependency property
public static readonly DependencyProperty FromProperty
public GridLength To { get; set; } // Dependency property
public static readonly DependencyProperty ToProperty
public override Type TargetPropertyType // Returns typeof(GridLength)
public override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationClock animationClock)
protected override Freezable CreateInstanceCore() // Returns new GridLengthAnimation()
Custom animation timeline for animating GridLength values. Supports both pixel and star-based grid units, preserving the GridUnitType from the To property.
ISOPopup
public partial class ISOPopup : Popup
public ISOPopup() // Constructor
// Private event handlers (wired via XAML):
private void ISOPart_OnPreviewKeyUp(object sender, KeyEventArgs e) // Filters input to alphanumeric and control keys only
private void ISOPart_OnGotMouseCapture(object sender, MouseEventArgs e) // Selects all text in TextBox
private void ISOPart_OnGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) // Selects all text in TextBox
A Popup control that restricts input to letters (A-Z), digits (0-9, NumPad0-9), and control keys (Enter, Tab, Delete, Back, Home, End, OemQuestion, OemBackTab).
LookupPopup
public partial class LookupPopup : Popup
public LookupPopup() // Constructor
public IEnumerable<IChannelCode> AllChannelCodes { get; private set; }
public delegate void ChannelCodeSelectedEventHandler(object sender, string code, string name);
public event ChannelCodeSelectedEventHandler ChannelCodeSelected
public static readonly DependencyProperty PossibleChannelsProperty
public IList PossibleChannels { get; set; } // Default: empty list with anonymous objects
// Private event handlers:
private void LookupPopup_OnOpenedClosed(object sender, EventArgs e) // Commented-out implementation
private void PossibleChannels_OnMouseDoubleClick(object sender, MouseButtonEventArgs e) // Raises ChannelCodeSelected
A Popup for selecting channel codes from a DataGrid. Uses reflection to extract Code and Name properties from items.
TestIdPreFixSuffixHelper & Related Classes
public enum TestIdFixedPrefixSuffixValues
{
NotFixed = -1,
None = 0,
TimeStamp = 1,
TestSetupName = 2
}
public class TestIdPreFixSuffix
public TestIdPreFixSuffix(TestIdFixedPrefixSuffixValues fixedPrefixSuffix)
public TestIdPreFixSuffix(string dbPrefixSuffix)
public TestIdFixedPrefixSuffixValues FixedValue { get; } // Default: NotFixed
public override string ToString() // Returns "TESTID_PREFIX_SUFFIX_{value}" or the db string
public class TestIdPreFixSuffixHelper : BasePropertyChanged
public TestIdPreFixSuffixHelper(string testIdPreFixSuffix)
public TestIdPreFixSuffixHelper(TestIdFixedPrefixSuffixValues testIdPreFixSuffix)
public TestIdPreFixSuffix TestIdPreFixSuffix { get; }
public override string ToString() // Looks up localized string via ResourceManager
public override bool Equals(object obj)
Helper classes for managing test ID prefix/suffix values with support for both fixed enumerated values and database-defined strings.
AutoSizedGridView
public class AutoSizedGridView : GridView
protected override void PrepareItem(ListViewItem item)
A GridView that automatically resizes columns marked with Width="Auto" and restores lost width bindings. Tracks columns via hash codes.
DynamicGrid
public class DynamicGrid : Grid, INotifyPropertyChanged
public DynamicGrid() // Constructor, calls Refresh()
public byte GridColumns { get; set; } // Default: 2
public void Refresh()
// INotifyPropertyChanged implementation:
public event PropertyChangedEventHandler PropertyChanged
protected bool SetProperty<T>(ref T storage, T value, string propertyName = null)
protected void OnPropertyChanged(string propertyName = null)
A Grid that automatically arranges children in a configurable number of columns. All columns except the last use Auto width; the last uses Star. Adds a final Star-height row at the bottom.
TestIDViewModel
public class TestIDViewModel : INotifyPropertyChanged
public string TestSetupLabel { get; set; } // Default: string.Empty
public Visibility TestSetupLabelVisibility { get; } // Collapsed if label is empty
public string TestIdEditableText { get; set; } // Default: string.Empty
public string TestName { get; set; }
public void PopulateAllTestIdPrefixSuffixValues(string[] serializedValues)
public TestIdPreFixSuffixHelper[] AllTestIdPrefixSuffixValues { get; }
public TestIdPreFixSuffixHelper SelectedTestIdPrefixValueItem { get; set; } // Default: None
public TestIdPreFixSuffixHelper SelectedTestIdSuffixValueItem { get; set; } // Default: TimeStamp
public string GetTestId()
public string GetTestIdTimestamp() // Format: "YYYY_MM_DD HH_MM"
ViewModel for constructing test IDs from prefix, label, editable text, and suffix components.
TestIdControl
public partial class TestIdControl : UserControl, INotifyPropertyChanged
public TestIdControl() // Constructor
// Same public interface as TestIDViewModel:
public string TestSetupLabel { get; set; }
public Visibility TestSetupLabelVisibility { get; }
public string TestIdEditableText { get; set; }
public string TestName { get; set; }
public void PopulateAllTestIdPrefixSuffixValues(string[] serializedValues)
public TestIdPreFixSuffixHelper[] AllTestIdPrefixSuffixValues { get; }
public TestIdPreFixSuffixHelper SelectedTestIdPrefixValueItem { get; set; }
public TestIdPreFixSuffixHelper SelectedTestIdSuffixValueItem { get; set; }
public string GetTestId()
public string GetTestIdTimestamp()
Note: Comment indicates this control should be removed after TTS module deletion and migration to new test setup wizard.
GridViewColumnHeaderSelectable
public partial class GridViewColumnHeaderSelectable : UserControl, IBasePropertyChanged
public GridViewColumnHeaderSelectable() // Constructor, subscribes to ListViewStatusEvent
public string ListviewId { get; set; } // Dependency property, default: ""
public string HeaderTitle { get; set; } // Dependency property, default: "Awesome"
public bool ToggleButtonIsChecked { get; set; } // Default: false
// Routed events:
public static readonly RoutedEvent OpenChangedEvent
public event RoutedEventHandler OpenChanged
public static readonly RoutedEvent ClickEvent
public event RoutedEventHandler ClickHandler
public static readonly RoutedEvent SelectAllEvent
public event RoutedEventHandler SelectAll
A column header with a toggle button popup for selection. Raises OpenChanged, ClickHandler, and SelectAll routed events.
GridViewColumnHeaderSearchable
public partial class GridViewColumnHeaderSearchable : UserControl, IBasePropertyChanged
public GridViewColumnHeaderSearchable() // Constructor, subscribes to ListViewStatusEvent
public string ListviewId { get; set; } // Dependency property
public string HeaderTitle { get; set; } // Dependency property, default: "Awesome"
public bool ToggleButtonIsChecked { get; set; }
public string HeaderSearchTerm { get; set; } // Dependency property, default: ""
public Geometry ToggleIconGeometry { get; } // Returns DownArrowIconGeometry or FilterIconGeometry
// Routed events:
public static readonly RoutedEvent OpenChangedEvent
public event RoutedEventHandler OpenChanged
public static readonly RoutedEvent ClickEvent
public event RoutedEventHandler ClickHandler
public static readonly RoutedEvent SearchEvent
public event RoutedEventHandler Search
// Converter:
public class BoolToInvertedBoolConverter : IValueConverter
A searchable column header with a popup. Displays different icons based on whether a search term is active.
GridViewColumnHeaderSearchableCheckBox
public partial class GridViewColumnHeaderSearchableCheckBox : UserControl, IBasePropertyChanged
public GridViewColumnHeaderSearchableCheckBox() // Constructor, subscribes to ListViewStatusEvent
public string ListviewId { get; set; } // Dependency property
public string HeaderTitle { get; set; } // Dependency property, default: "Awesome"
public bool ToggleButtonIsChecked { get; set; }
public string HeaderSearchTerm { get; set; } // Dependency property
public Geometry ToggleIconGeometry { get; }
// Routed events:
public static readonly RoutedEvent OpenChangedEvent
public event RoutedEventHandler OpenChanged
public static readonly RoutedEvent ClickEvent
public event RoutedEventHandler ClickHandler
public static readonly RoutedEvent SearchEvent
public event RoutedEventHandler Search
public static readonly RoutedEvent FilterEvent
public event RoutedEventHandler Filter // Raised with "All", "True", or "False"
A column header combining search and boolean filtering with All/True/False buttons.
3. Invariants
- GridLengthAnimation: The
GridUnitType(Star or Pixel) is always taken from theToproperty, notFrom. - ISOPopup: Input is restricted to alphanumeric characters and specific control keys; all other keys set
e.Handled = true. - DynamicGrid: The last column always has
GridUnitType.Star; all others haveGridUnitType.Auto. A final row withStarheight is always appended. - AutoSizedGridView: Column tracking uses
GetHashCode(); if column collection changes, internal caches are rebuilt. - LookupPopup: Items in
PossibleChannelsmust haveCodeandNameproperties accessible via reflection. - TestIdPreFixSuffixHelper.Equals: Two helpers are equal if they have the same
FixedValue(when notNotFixed), or if both areNotFixedand their string representations match. - TestIDViewModel/TestIdControl:
GetTestId()joins non-empty components with underscores in order: prefix → TestSetupLabel → TestIdEditableText → suffix. - GridViewColumnHeader controls*: All subscribe to
ListViewStatusEventand clear state when receivingUnloadedstatus matching theirListviewId.
4. Dependencies
This module depends on:
System.Windows(WPF core)System.Windows.ControlsSystem.Windows.Controls.PrimitivesSystem.Windows.DataSystem.Windows.InputSystem.Windows.Media.AnimationMicrosoft.Practices.ServiceLocation(ServiceLocator)Microsoft.Practices.Prism.Events(IEventAggregator, ThreadOption)DTS.Common.Base(BasePropertyChanged, IBasePropertyChanged)DTS.Common.Events(HelpTextEvent, HelpTextEventArg, ListViewStatusEvent, ListViewStatusArg)DTS.Common.Interface.Channels.ChannelCodes(IChannelCode)DTS.Common.Utilities.Logging(imported but usage not visible in provided source)DTS.Strings.Strings(ResourceManager for localization)
What depends on this module:
- Cannot be determined from source alone; these are UI controls likely used by various modules throughout the DTS application.
5. Gotchas
-
TestIdControl is deprecated: The source explicitly states "Remove this control after deleting the TTS module and migrating to new test setup wizard." New code should use
TestIDViewModelinstead. -
LookupPopup uses reflection:
PossibleChannels_OnMouseDoubleClickusesGetProperty("Code")andGetProperty("Name")via reflection on anonymous-type-like objects. This is fragile and will fail silently (returning null) if properties don't exist. -
RoundedBox.Connect is a stub: The method throws
NotImplementedException(commented out). Its purpose is unclear from source. -
GridViewColumnHeaderSelectable.OnListviewStatusEvent has empty body: When
arg.Id == ListviewId, there's no actual logic executed—just an empty if block. -
AutoSizedGridView uses hash codes for column identity: Column tracking relies on
GetHashCode(), which could theoretically collide (though unlikely in practice). -
checkbox class lacks constructor: The partial class
checkboxhas no constructor shown;InitializeComponent()must be called from the XAML-generated part. -
BoolToInvertedBoolConverter.ConvertBack throws: The
ConvertBackmethod throwsNotImplementedException, making it unsuitable for two-way bindings. -
GridLengthAnimation doesn't validate animationClock.CurrentProgress:
GetCurrentValueaccessesanimationClock.CurrentProgress.Valuewithout null checking; could throw if progress is null. -
DynamicGrid.Refresh clears and rebuilds all definitions: Called on every
GridColumnschange and every visual child change; may have performance implications for grids with many children. -
TestIDViewModel.TestIdEditableText property notification missing: The property setter doesn't raise
PropertyChanged, unlike other properties.