ITextProvider.GetSelection Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Retrieves a collection of disjoint text ranges that are associated with the current text selection or selections.
Assembly: System.Windows (in System.Windows.dll)
Return Value
Type: System.Windows.Automation.Provider.ITextRangeProvider ()A collection of disjoint text ranges.
| Exception | Condition |
|---|---|
| InvalidOperationException | If the UI Automation provider does not support text selection. |
For UI Automation providers that support text selection, the provider should implement this method and also return a SupportedTextSelection value.
If no text is selected, GetSelection returns the degenerate text range (empty range) at the position of the system cursor (the text insertion point).
If the system cursor is not present, GetSelection may return Nothing.