6.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T03:00:05.086114+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 3ef2c7de36c1e3c6 |
Networking
Documentation: Networking Interface Module
1. Purpose
This module defines the core interfaces for the networking layer’s view-model and view components within the DTS system. It establishes a contract for UI components responsible for displaying and managing network adapter selection and SLICE6 multicast communication settings. The interfaces are part of a layered architecture (likely MVVM), where *ViewModel interfaces encapsulate state and behavior, and *View interfaces represent the UI presentation layer—both inheriting from IBaseView/IBaseViewModel to integrate with the common base framework.
2. Public Interface
-
INetworkingViewpublic interface INetworkingView : IBaseView { }Represents the UI view for the networking module. No additional members beyond the base view contract—implementation is expected to handle rendering of networking-related UI (e.g., adapter list, multicast config fields).
-
INetworkAdapterViewpublic interface INetworkAdapterView : IBaseView { }Represents the UI view for network adapter selection. Like
INetworkingView, it only inheritsIBaseView, implying its implementation is responsible for UI-specific adapter display (e.g., a dropdown or list ofNetworkInterfaceobjects). -
INetworkAdapterViewModelpublic interface INetworkAdapterViewModel : IBaseViewModel { NetworkInterface SelectedNetworkInterface { get; set; } }Manages state for network adapter selection. Exposes a single property,
SelectedNetworkInterface, which holds the currently selectedSystem.Net.NetworkInformation.NetworkInterface. The property is read-write, implying the view model supports both programmatic and user-driven selection updates. -
INetworkingViewModelpublic interface INetworkingViewModel : IBaseViewModel { INetworkingView View { get; set; } string SLICE6MulticastAddress { get; set; } bool SLICE6MulticastAddressHasError { get; } int SLICE6MulticastCommandPort { get; set; } int SLICE6MulticastResponsePort { get; set; } void SetStatus(StatusInfo.StatusState status, string message = "", decimal percentage = -1, int processId = 0); }Manages state and behavior for the main networking configuration UI.
View: Binds to the associatedINetworkingViewinstance (likely set by a framework or presenter).SLICE6MulticastAddress: Gets/sets the multicast IP address string used for SLICE6 communication.SLICE6MulticastAddressHasError: Read-only flag indicating whether the currentSLICE6MulticastAddressvalue is invalid (e.g., malformed or unresolvable).SLICE6MulticastCommandPort/SLICE6MulticastResponsePort: Get/set integer port numbers for command and response multicast channels.SetStatus(...): Updates the UI status bar with aStatusInfo.StatusState(e.g.,Idle,Processing,Error), optional message, progress percentage (−1 if not applicable), and process ID for tracking.
3. Invariants
INetworkingViewModelimplementations must ensureSLICE6MulticastAddressHasErroraccurately reflects the validity ofSLICE6MulticastAddress(e.g.,trueif the address is null, empty, or not a valid IPv4/IPv6 multicast address).SelectedNetworkInterfaceinINetworkAdapterViewModelmust be non-null only when a validNetworkInterfaceis selected; setting it tonulllikely indicates no selection.Viewproperty inINetworkingViewModelmust be assigned before the view model is used to interact with the UI (e.g., before callingSetStatus).SetStatusmust be thread-safe or callable from UI thread only (implementation-dependent; not specified in interface).
4. Dependencies
- Internal dependencies:
DTS.Common.Basenamespace (providesIBaseView,IBaseViewModel, and likelyStatusInfo.StatusState).System.Net.NetworkInformation(forNetworkInterfacetype).System.Threading.Tasks(imported but no async methods declared—possibly reserved for future use or implementation).DTS.Common.Events(imported but no event types used in interface—likely for status change events or command bindings).
- Consumers:
- View implementations (e.g., WPF/WinForms controls) implementing
INetworkingView/INetworkAdapterView. - View model implementations (e.g.,
NetworkingViewModel,NetworkAdapterViewModel) implementingINetworkingViewModel/INetworkAdapterViewModel. - Likely consumed by a presenter or controller layer (not visible in this module).
- View implementations (e.g., WPF/WinForms controls) implementing
5. Gotchas
SLICE6MulticastAddressHasErroris read-only—validation logic must be implemented internally (e.g., on property setter or external validation trigger). The interface does not specify when or how this flag is updated.SetStatusparameterspercentageandprocessIdhave defaults (-1and0), but their semantics (e.g., whetherpercentage = -1means "indeterminate" or "not applicable") are not documented here.SelectedNetworkInterfaceis a direct reference toNetworkInterface—implementations must handle disposal or lifecycle concerns if the underlying interface becomes unavailable (e.g., network cable unplugged).- No methods for loading or refreshing the list of available network interfaces are exposed—assumed to be handled by external logic (e.g., in a concrete view model not shown).
- None of the interfaces define events (e.g.,
PropertyChanged, selection changed), implying eventing is handled viaIBaseViewModel/IBaseViewbase contracts or external mechanisms (e.g.,DTS.Common.Events).
Note: No implementation details (e.g., validation rules for multicast addresses, error handling for port ranges) are present in the source—these must be inferred from concrete implementations.