Docsv3.20.2
Back to API Reference
Struct

TextCommandContext

sealed

The field a TextCommand is asked about or run against, in its state at that moment.

public UniTextSelectable Selectable{ get }

Selection component of the field; its Selection is what a command acts on.

public UniTextEditable Editable{ get }

Enabled editing layer of the field, or for read-only selectable text.

public bool CanCopy{ get }

Whether a non-collapsed selection exists and the field's copy policy lets its text leave the field — false in a password field. A command that hands the selected text to anything else checks it.

public bool CanEdit{ get }

Whether the field accepts edits: an editing layer is enabled and not read-only.

[ctor]public TextCommandContext()

Captures the field of selectable, so a command can also run outside a menu — from a toolbar button or a shortcut.

public CapturedSelection CaptureSelection()

Captures the selection for a replacement that arrives later, after asynchronous work.