Skip to content

InterfaceSelection

Class in Oadm.Sdk.Client.Network · Oadm.Sdk.Client.dll

The “Listen on” select of a network service page (NTP server, DHCP server): the server’s interfaces as the server lists them, the selection kept across refreshes, and a configured interface that is gone stays selectable as “Ethernet (not available)” so the user sees what is configured. Bind a ComboBox to InterfaceSelection.Items and InterfaceSelection.Selected (item text: InterfaceOption.Label).

public sealed class InterfaceSelection : ObservableObject

Inherits ObservableObject

ObservableCollection<InterfaceOption> Items { get; }

The choices of the select (bind ItemsSource).

InterfaceOption? Selected { get; set; }

The chosen interface (bind SelectedItem).

string? SelectedId { get; }

Id of the selected interface, null when nothing is selected.

void Apply(IReadOnlyList<InterfaceOption> options, string? configuredId, string? configuredName)

Replaces the list (a refresh). The current selection, else configuredId, stays selected; a configured interface missing from the list is added as “(not available)”. Empty lists are ignored.

InterfaceOption? Find(string? id)

The choice with this interface id, or null.

void Select(string? id)

Selects the interface with this id (the form was loaded or saved); the first one when it is not listed.