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 : ObservableObjectInherits ObservableObject
Constructors
Section titled “Constructors”PageDeviceChoice
Section titled “PageDeviceChoice”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.
Properties
Section titled “Properties”ButtonText
Section titled “ButtonText”string ButtonText { get; }The text of the button: “Choose devices”, “Selected devices: All”, “Selected devices: Tag Building A and 3 devices”.
Choice
Section titled “Choice”DeviceChoice Choice { get; private set; }The current choice.
IsEmpty
Section titled “IsEmpty”bool IsEmpty { get; }Nothing chosen yet: the page reads nothing.
Methods
Section titled “Methods”Candidates
Section titled “Candidates”IReadOnlyList<IDeviceInfo> Candidates()The devices the page can use (what the picker lists).
PickAsync
Section titled “PickAsync”Task<bool> PickAsync(Window owner, string heading)Opens the shared device picker (All devices, tags, chosen devices); true when a choice was made.
Resolve
Section titled “Resolve”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.
Fields
Section titled “Fields”MaxRememberedDevices
Section titled “MaxRememberedDevices”const int MaxRememberedDevices = 1000A choice with more single devices than this is not remembered (tags and All devices always are).
SettingKey
Section titled “SettingKey”const string SettingKey = "deviceChoice"Key of the remembered choice in the plugin’s settings on this computer.