Skip to content

PageDeviceChoice

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

The device choice of a page that reads many devices (the purple “Selected devices” button): All devices, tags and chosen devices, the text of the button, the devices it means now, and the last choice kept on this computer. The page starts with the Devices page selection when there is one, else with its last choice, else with nothing (“Choose devices”), and reads only the devices of the choice (docs/30kspec.md, section 5).

public sealed class PageDeviceChoice : ObservableObject

Inherits ObservableObject

PageDeviceChoice(ICorePluginClientContext ctx, string noun = "devices", Func<IDeviceInfo, bool>? fits = null)

Creates the choice of a page.

Parameters

  • ctx: The page’s context: devices, the Devices page selection, the settings on this computer.
  • noun: “devices” or “cameras”: the button says “Choose cameras”, “Selected cameras: Tag Building A”.
  • fits: Which devices the page can use (e.g. video devices); others are left out. Null: every device.
string ButtonText { get; }

The text of the button: “Choose devices”, “Selected devices: All”, “Selected devices: Tag Building A and 3 devices”.

DeviceChoice Choice { get; private set; }

The current choice.

bool IsEmpty { get; }

Nothing chosen yet: the page reads nothing.

IReadOnlyList<IDeviceInfo> Candidates()

The devices the page can use (what the picker lists).

Task<bool> PickAsync(Window owner, string heading)

Opens the shared device picker (All devices, tags, chosen devices); true when a choice was made.

IReadOnlyList<IDeviceInfo> Resolve()

The devices of the choice now: all usable devices, or the chosen ones and those with a chosen tag. O(devices).

void Set(DeviceChoice choice)

Sets the choice, keeps it on this computer and tells the page.

const int MaxRememberedDevices = 1000

A choice with more single devices than this is not remembered (tags and All devices always are).

const string SettingKey = "deviceChoice"

Key of the remembered choice in the plugin’s settings on this computer.