Skip to content

DeviceTreeModel

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

The rows of a device tree: the devices grouped by tag in tag order (a device with several tags under each, “No tag” last), sorted by address, filtered by a search and an optional DeviceTreeModel.Filter; collapsed groups hide their devices. One reset per rebuild, O(devices x tags): 5,000 devices are fine.

public sealed class DeviceTreeModel
IReadOnlyList<DeviceTreeDevice> DeviceRows { get; }

Every device row, also those of collapsed groups.

Func<IDeviceInfo, bool>? Filter { get; init; }

Only these devices are listed (e.g. devices with video); null lists all.

RangeObservableCollection<DeviceTreeRow> Rows { get; }

Group headers and the devices of expanded groups, for the list.

int UsableCount { get; private set; }

The number of devices the last rebuild listed, before the search (devices the page can use).

static bool Matches(IDeviceInfo device, string search)

The search matches address, model, MAC address, host name or a tag.

void Rebuild(IReadOnlyList<IDeviceInfo> devices, string search)

Builds the rows from devices and search in one reset.

void Toggle(DeviceTreeGroup group)

Collapses or expands a group (the rows are rebuilt).

const string NoTag = "No tag"

The group of devices without a tag, always last.