Back to API Reference
Struct

TextUnitSequence

sealed

The units of one stretch of processed text, in logical order. Enumerating allocates nothing and reads the pass's own analysis, so a query costs one walk of the range and no text work.

Remarks

A snapshot of nothing: the sequence holds the component, not its buffers, and resolves them on GetEnumerator. Enumerate it inside the frame you obtained it in — a rebuild between the two gives the next enumeration the new text, and a rebuild during one is a programming error the enumerator does not guard against.
public int Count{ get }

Number of units the range holds; a partial unit at either edge counts as one.

public TextUnitEnumerator GetEnumerator()

Returns a struct enumerator over the range's units.