ControlDispatch class Core

The one way a host drives a control tree from outside its pointer path: what assistive technology reads and does, the keyboard coming in and going out (Tab from outside, Tab past the last control), the keys and the typing, the clipboard and the caret the input method anchors to. The board shown in a grid and the ArionControlSurface of every host take the same path, so a text box or a button behaves the same wherever it is drawn.

Every change runs through the owner's gate: a board runs it under its render gate and repaints exactly what the change touched; a surface runs it as it comes.

public sealed class ControlDispatch
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease

Constructors

ControlDispatch

public ControlDispatch(ControlHost host);

A dispatch over host that runs every change as it comes.

Properties

CaretRect

public LogRect? CaretRect { get; }

The caret of the focused text box where it is drawn, in the tree's coordinates; null without one. The input method's candidate window hangs here.

Clipboard

public IClipboardText? Clipboard { get; set; }

The platform's clipboard for the tree's text boxes; null for none. Pasted text arrives through the owner's gate like every other change.

Host

public ControlHost Host { get; }

The tree this dispatch drives.

Methods

CanTab

public bool CanTab(bool reverse);

Whether Tab (Shift+Tab: reverse) stays in the tree - what a host asks before it claims the key from the window's own tab order.

EnterFromOutside

public bool EnterFromOutside(bool reverse);

The keyboard arrived from outside with Tab (Shift+Tab: reverse): the first focusable control takes it, going backwards the last - whatever held the focus when the keyboard left. False when the tree has no tab stop.

FocusFirstIfNone

public bool FocusFirstIfNone();

The keyboard arrived some other way (focus given in code, F6, the window coming back): the control that held it when it left takes it again, else the first one - unless one holds it already. False when none can.

Invoke

public bool Invoke(string id);

Act like a click on the part.

Key

public bool Key(ArionKey key, ArionModifiers mods);

One key. Tab steps through the controls and answers false past the last one, so the window's own tab order carries on; every other key goes to the focused control.

Key

public bool Key(ArionKey key, ArionModifiers mods, char letter);

As ControlDispatch.Key; letter carries Z and Y for the hosts that do not map them to ArionKey (see ControlDispatch.KeyOf).

KeyOf

public static ArionKey KeyOf(ArionKey key, ArionModifiers mods, char letter);

The key a host hands on, with the Ctrl shortcuts made keys: hosts send Z, Y, F and K as a letter, and a control (a text box, a table in a view tile, also in a pane over the tree) sees only the key.

LetterOf

public static char LetterOf(ArionKey key);

The shortcut letter of a key (the reverse of ControlDispatch.KeyOf): what a control hands on to a grid that reads its shortcuts as letters; the null character for a key that is no letter.

Part

public AccessiblePart? Part(string id);

One part, read live; null when it is not shown.

Parts

public IReadOnlyList<AccessiblePart> Parts(string? groupId = null);

The parts directly inside the group groupId, or at the top of the tree for null - what a host's automation peer lists as its children.

RangeOf

public AccessibleRange? RangeOf(string id);

The range of a range part; null when it has none.

SetRangeValue

public bool SetRangeValue(string id, double value);

Set the value of a range part, as the user could.

SetValue

public bool SetValue(string id, string value);

Replace the text of a text part, as typing would.

Text

public bool Text(string text);

Typing, to the focused text box (or the first one, see ControlHost.OnText).

ToggleStateOf

public bool? ToggleStateOf(string id);

The checked state of a toggle part; null when it does not toggle.

ValueOf

public string? ValueOf(string id);

The text of a text part (a cell's value); null when it carries none.