6.0 KiB
6.0 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T02:31:01.486440+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 785426dcfee2c243 |
ExtraProperties
1. Purpose
This module defines the core interfaces for managing a list of extra properties—custom key-value metadata associated with ISO-compliant data objects—in a WPF-based UI layer. It establishes a clean separation between view (IExtraPropertiesListView), view model (IExtraPropertiesListViewModel), and individual property data (IExtraProperty) to support data binding, editing, validation, and user interactions (copy, delete, sort, filter, paste) in a structured, testable manner. The module exists to abstract the UI logic for handling dynamic, user-defined properties while enforcing consistency with the broader DTS.Common architecture.
2. Public Interface
IExtraPropertiesListView
- Inherits:
IBaseView - Description: A marker interface for the view (e.g., XAML user control) that renders the extra properties list. No additional members—behavior is entirely driven by the view model.
IExtraPropertiesListViewModel
- Inherits:
IBaseViewModel - Properties:
IExtraPropertiesListView View { get; set; }— Binds to the associated view instance.ObservableCollection<IExtraProperty> ExtraProperties { get; set; }— The mutable collection of properties displayed/managed.bool IsReadOnly { get; set; }— Controls whether edits are permitted.IExtraProperty[] SelectedProperties { get; }— Returns currently selected items in the UI (read-only snapshot).
- Methods:
void SetPage(IDataPROPage page)— Associates the view model with a specific data page context (likely for persistence or scoping).void SetParent(object parent)— Sets a parent object (e.g., containing entity), though its exact use is not specified in the interface.void SetExtraProperties(IList<IExtraProperty> properties)— Replaces the currentExtraPropertiescollection with a new list.void CopySelected()— Copies selected properties (likely to clipboard or internal buffer).void DeleteSelected()— Removes selected properties fromExtraProperties.void Filter(object tag, string term)— Filters the displayed properties based on a search term (term) and optionaltag(e.g., column or field identifier).void Sort(object o, bool columnClick)— Sorts the properties, whereolikely identifies the sort key/column andcolumnClickindicates whether the sort was triggered by UI interaction.bool Validate(ref List<string> errors)— Validates all properties inExtraProperties; returnsfalseand populateserrorsif any property fails validation.
IExtraProperty
- Inherits:
INotifyPropertyChanged - Properties:
string Key { get; set; }— The property’s name/identifier.string Value { get; set; }— The property’s value.UIItemStatus ItemStatus { get; set; }— Current UI validation/status state (e.g.,Success,Failed,Warning—values defined inDTS.Common.Enums).
- Commands:
ICommand PasteCommand { get; set; }— Handles paste operations, supporting multi-row pastes (e.g., CSV) into a single field.
3. Invariants
ExtraPropertiesmust be anObservableCollection<IExtraProperty>to support UI data binding and change notifications.IsReadOnlycontrols mutability: whentrue, operations likeDeleteSelected()and edits toKey/Valueshould be disabled (enforced by the view or view model implementation).SelectedPropertiesis a snapshot of the current selection at the time of access—its contents may change independently of the view model’s internal state.Validate(ref List<string> errors)must populateerrorswith human-readable messages for all invalid properties, not just the first failure.PasteCommandis expected to handle multi-line or multi-property pastes (e.g., pasting multiple rows into one cell), though the exact behavior is implementation-defined.
4. Dependencies
- Depends on:
DTS.Common.Base(forIBaseView,IBaseViewModel)DTS.Common.Enums(forUIItemStatus)System.Collections.ObjectModel(forObservableCollection<T>)System.Windows.Input(forICommand)
- Depended on by:
- Likely consumed by UI components (e.g.,
UserControlimplementingIExtraPropertiesListView) and higher-level view models managing ISO data pages (e.g.,IDataPROPageimplementations). IDataPROPage(referenced inSetPage) is assumed to be defined elsewhere inDTS.Common.Base.
- Likely consumed by UI components (e.g.,
5. Gotchas
- Ambiguous
SetParentusage: Theobject parentparameter lacks type safety or documentation—implementers must infer its role (e.g., parent entity, container, or context object). Filter/Sortsignature ambiguity: Theobject tagandobject oparameters inFilterandSortare untyped; their expected types (e.g.,string,int, or custom enum) are not specified.SelectedPropertiesis read-only: The array is not live-updated; consumers must re-query after selection changes.- No explicit thread-safety guarantees:
ObservableCollectionis not thread-safe; modifications must occur on the UI thread (standard WPF constraint). PasteCommandbehavior is underspecified: While documented as handling multi-row pastes, the interface does not define how pasted data is parsed or distributed (e.g., row/column splitting).- No event for selection changes: The interface lacks a
SelectedPropertiesChangedevent—consumers must rely on external mechanisms (e.g., binding toICollectionView.SelectionChanged).
None identified beyond the above.