Class AccessibilityTreeWatcher

Namespace
Forma
Assembly
Forma.dll

Tracks whether the accessibility tree could have changed, so consumers re-capture on a signal instead of walking the whole tree every frame.

Deliberately conservative: it reports possible change, never certainty. A control raising AccessibilityChanged may have changed something the snapshot does not carry, in which case the diff simply comes back empty — cheap, and far safer than missing a real change.

public sealed class AccessibilityTreeWatcher : IDisposable
Inheritance
AccessibilityTreeWatcher
Implements
Inherited Members

Constructors

AccessibilityTreeWatcher(UIContext)

Starts watching a context. Dispose to unsubscribe.

public AccessibilityTreeWatcher(UIContext context)

Parameters

context UIContext

Properties

Current

The most recent snapshot, or null before the first Update().

public AccessibilityTreeSnapshot Current { get; }

Property Value

AccessibilityTreeSnapshot

IsDirty

Whether something may have changed since the last Update().

public bool IsDirty { get; }

Property Value

bool

Methods

Dispose()

Unsubscribes from the context and every control it was listening to.

public void Dispose()

Invalidate()

Forces the next Update() to re-capture.

public void Invalidate()

Update()

Re-captures when dirty and returns what changed. When nothing is dirty this does no work and returns an empty delta, which is the whole point of the type.

public AccessibilityTreeDelta Update()

Returns

AccessibilityTreeDelta