6.4 KiB
6.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||
|---|---|---|---|---|---|---|---|
|
2026-04-16T03:06:05.680006+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | fa52f93f74894066 |
ExtraProperties
Documentation: Extra Properties List Module
1. Purpose
This module defines the interface contracts for managing a list of extra properties—custom key-value metadata associated with data objects in the ISO data processing pipeline. It provides a standardized view-model and view layer abstraction for displaying, editing, filtering, sorting, and manipulating these properties in a UI (likely WPF, given ICommand and ObservableCollection). The module exists to decouple UI logic for extra properties from domain-specific implementations, enabling reuse across different ISO data entry or review workflows.
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 are defined here; behavior is driven entirely by the view model.
IExtraPropertiesListViewModel
- Inherits:
IBaseViewModel - Methods & Properties:
void SetPage(IDataPROPage page)
Sets the data context page (likely representing a step or section in a data entry workflow) for the list.void SetParent(object parent)
Assigns a parent object (e.g., a container or parent view model) for navigation or coordination.IExtraPropertiesListView View { get; set; }
Gets or sets the associated view instance (MVVM pattern binding).void CopySelected()
Copies currently selected extra properties to the clipboard (likely in a structured format like CSV or tab-delimited).void DeleteSelected()
Removes the selected extra properties from the list.ObservableCollection<IExtraProperty> ExtraProperties { get; set; }
The collection of extra properties displayed in the list; supports change notification.void SetExtraProperties(IList<IExtraProperty> properties)
Replaces the currentExtraPropertiescollection with a new list of properties.void Filter(object tag, string term)
Filters the list based onterm(search string), optionally scoped bytag(e.g., column or category identifier).void Sort(object o, bool columnClick)
Sorts the list, whereolikely identifies the sort key (e.g., column header), andcolumnClickindicates if triggered by UI interaction.bool Validate(ref List<string> errors)
Validates all extra properties in the list; returnsfalseand populateserrorsif any validation failures occur.bool IsReadOnly { get; set; }
Controls whether the list is editable (true= read-only,false= editable).IExtraProperty[] SelectedProperties { get; }
Returns an array of currently selected extra properties (read-only; no setter).
IExtraProperty
- Inherits:
INotifyPropertyChanged - Properties & Commands:
string Key { get; set; }
The property’s name/key (e.g.,"Manufacturer","BatchID").string Value { get; set; }
The property’s value (e.g.,"Acme Corp","B-2024-001").ICommand PasteCommand { get; set; }
A command invoked when pasting data (e.g., multi-row CSV) into a single field. Handles parsing and splitting into multiple properties.UIItemStatus ItemStatus { get; set; }
Indicates UI validation status (e.g.,Success,Failed,Warning)—values defined inDTS.Common.Enums.UIItemStatus.
3. Invariants
ExtraPropertiesmust be anObservableCollection<IExtraProperty>; direct replacement viaSetExtraPropertiesmust trigger collection change notifications.SelectedPropertiesis read-only and reflects the current selection state at the time of access (no guarantee of immutability beyond the array copy).IsReadOnlyapplies globally to all properties in the list; whentrue, edits toKey/Valueshould be blocked.Validatemust inspect all properties inExtraPropertiesand returnfalseif any property fails validation (e.g., emptyKey, invalidItemStatus).PasteCommandis expected to handle multi-row input (e.g., newline- or comma-separated values) and may create/modify multipleIExtraPropertyinstances.FilterandSortoperations must operate on the currentExtraPropertiescollection without mutating the underlying data source (unless explicitly intended).
4. Dependencies
This module depends on:
DTS.Common.Base(forIBaseView,IBaseViewModel)DTS.Common.Enums(forUIItemStatus)- Standard .NET types:
System.Collections.ObjectModel.ObservableCollection<T>,System.ComponentModel.INotifyPropertyChanged,System.Windows.Input.ICommand
This module is depended upon by:
- UI components implementing
IExtraPropertiesListView(e.g., WPF user controls). - View models or services that manage ISO data pages (e.g.,
IDataPROPageimplementations) requiring extra property editing. - Concrete implementations of
IExtraProperty(e.g.,ExtraPropertyclass in a derived project).
5. Gotchas
- No explicit thread-safety guarantees:
ObservableCollectionis not thread-safe; UI updates must occur on the UI thread. SetExtraPropertiesvs.ExtraProperties: Replacing the collection viaSetExtraPropertiesmay reset selection state (not specified). Consumers should re-select items if needed.FilterandSortsignatures are ambiguous:object tagandobject oare not typed—likelystringorDataGridColumnin practice, but the interface does not enforce this.PasteCommandbehavior is implementation-defined: While documented as handling multi-row pastes, the exact parsing logic (e.g., delimiters, row/column mapping) is not standardized here.SelectedPropertiesreturns an array: Calling code must not assume the array is a live view; it is a snapshot.- No error handling contract:
Validatepopulateserrors, but the interface does not specify whether partial failures are allowed or if validation stops on the first error.
None identified beyond the above.