Class AccessibilityTree

Namespace
Forma
Assembly
Forma.dll

Captures the accessibility tree of a UIContext.

The walk deliberately mirrors the rules input already follows — draw order, modal gating, rendered-only — rather than inventing its own. A tree that disagrees with input about what is reachable is worse than no tree: it tells a consumer to act on something that cannot be acted on.

public static class AccessibilityTree
Inheritance
AccessibilityTree
Inherited Members

Methods

Capture(UIContext)

Captures the currently visible tree. Layout is settled first, so bounds are real.

public static AccessibilityTreeSnapshot Capture(UIContext context)

Parameters

context UIContext

Returns

AccessibilityTreeSnapshot

Diff(AccessibilityTreeSnapshot, AccessibilityTreeSnapshot)

Compares two snapshots. A node counts as updated only when something the snapshot actually carries differs, so a repaint or a change to a property outside this projection produces an empty delta rather than a spurious push.

public static AccessibilityTreeDelta Diff(AccessibilityTreeSnapshot previous, AccessibilityTreeSnapshot current)

Parameters

previous AccessibilityTreeSnapshot
current AccessibilityTreeSnapshot

Returns

AccessibilityTreeDelta

TryPerformAction(UIContext, int, AccessibilityActions, object)

Walks the same controls Capture(UIContext) would, without building a snapshot.

public static bool TryPerformAction(UIContext context, int nodeId, AccessibilityActions action, object argument = null)

Parameters

context UIContext
nodeId int
action AccessibilityActions
argument object

Returns

bool

Whether the action was found, supported and accepted.

Remarks

A snapshot node is a value, so the live control has to be found again to act on it. The node may also have left the tree since the snapshot was taken, which is not an error: the answer is false, the same as for an action the control does not support.

The action must be one the control advertises. Invoking something unadvertised would let an outside caller reach behaviour a person cannot, which is exactly what an accessibility tree is supposed to rule out.