6.2 KiB
6.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:19:48.560146+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 9f8faed114584889 |
Networking
Documentation: Networking Interface Module
1. Purpose
This module defines a set of interfaces that establish the contract for networking-related UI and ViewModel layers within the application’s MVVM (Model-View-ViewModel) architecture. It enables separation of concerns by decoupling networking functionality (e.g., multicast configuration, network adapter selection) from concrete implementations, supporting testability and modularity. Specifically, it provides typed interfaces for views (INetworkingView, INetworkAdapterView) and view models (INetworkingViewModel, INetworkAdapterViewModel) that manage network adapter state and SLICE6 multicast communication parameters.
2. Public Interface
INetworkingView
- Signature:
public interface INetworkingView : IBaseView - Behavior: Represents the view layer for the networking UI. Inherits from
IBaseView, implying it participates in the base view lifecycle (e.g., binding, initialization). No additional members defined—acts as a marker interface for networking-specific views.
INetworkAdapterView
- Signature:
public interface INetworkAdapterView : IBaseView - Behavior: Represents the view layer for network adapter selection UI. Like
INetworkingView, it is a marker interface inheritingIBaseView, used to identify views responsible for network adapter presentation.
INetworkAdapterViewModel
- Signature:
public interface INetworkAdapterViewModel : IBaseViewModel - Behavior: Manages state for network adapter selection. Exposes a single property:
SelectedNetworkInterface: Gets or sets the currently selectedSystem.Net.NetworkInformation.NetworkInterface. This is the core data point for adapter-related logic.
INetworkingViewModel
- Signature:
public interface INetworkingViewModel : IBaseViewModel - Behavior: Coordinates high-level networking configuration, particularly for SLICE6 multicast communication. Key members:
View: Gets or sets the associatedINetworkingViewinstance (enabling view-model-to-view binding).SLICE6MulticastAddress: Gets or sets the IPv6 multicast address (e.g.,"ff02::1:2") as astring.SLICE6MulticastAddressHasError: Gets aboolindicating whether the currentSLICE6MulticastAddressvalue is invalid (e.g., malformed or unreachable).SLICE6MulticastCommandPort: Gets or sets the UDP port used for sending multicast commands (e.g.,5000).SLICE6MulticastResponsePort: Gets or sets the UDP port used for receiving multicast responses (e.g.,5001).SetStatus(StatusInfo.StatusState status, string message = "", decimal percentage = -1, int processId = 0): Updates the UI status (e.g., progress, error, success) via the view. Parameters align withStatusInfo.StatusState(fromDTS.Common.Base) and support optional progress/message context.
3. Invariants
INetworkingViewModel:SLICE6MulticastAddressHasErrormust betrueif and only ifSLICE6MulticastAddressis syntactically invalid or otherwise unusable (e.g., not a valid IPv6 multicast address).SLICE6MulticastCommandPortandSLICE6MulticastResponsePortmust be valid port numbers (0–65535), though validation is not enforced by the interface itself.Viewmust be assigned beforeSetStatusis called; otherwise, behavior is undefined (no null-safety guaranteed in interface).
INetworkAdapterViewModel:SelectedNetworkInterfacemay benull(e.g., if no adapter is selected), but implementations are expected to handle null gracefully (e.g., disable dependent operations).
- General: All interfaces extend
IBaseViewModel/IBaseView, implying adherence to base lifecycle contracts (e.g., disposal, initialization), though specifics are defined inDTS.Common.Base.
4. Dependencies
- Depends on:
DTS.Common.Base(providesIBaseView,IBaseViewModel, andStatusInfo.StatusState).System.Net.NetworkInformation(forNetworkInterface).System.Collections.Generic,System.Threading.Tasks,DTS.Common.Events(viaINetworkingViewModel, though no methods use them directly—likely for future extensibility or internal implementation).
- Depended on by:
- Concrete implementations of networking views (e.g., WPF/WinForms UI pages) and view models (e.g.,
NetworkingViewModel,NetworkAdapterViewModel). - Likely consumed by higher-level modules managing network configuration, device discovery, or SLICE6 protocol communication (inferred from
SLICE6Multicast*naming).
- Concrete implementations of networking views (e.g., WPF/WinForms UI pages) and view models (e.g.,
5. Gotchas
SLICE6MulticastAddressHasErroris read-only: Validation state is exposed via a getter, but the interface provides no method to explicitly trigger validation. Implementations must self-validate (e.g., on property setter or external events).- No explicit error details:
SLICE6MulticastAddressHasErroronly indicates whether an error exists, not why. Consumers must parseSLICE6MulticastAddressor rely on implementation-specific logging. SetStatussignature is generic: The method usesStatusInfo.StatusState(fromDTS.Common.Base), but the interface does not define what states exist (e.g.,Idle,Processing,Error). Consumers must referenceStatusInfoto interpret status transitions.- No async support in
INetworkingViewModel: DespiteSystem.Threading.Tasksbeing imported, no async methods are declared—suggesting networking operations may be handled elsewhere or via side effects. Viewproperty is bidirectional but unenforced: WhileINetworkingViewModelexposes aViewproperty, the interface does not specify when it must be set (e.g., during construction vs. binding). Null assignments may cause runtime failures inSetStatus.
None identified beyond the above.