ITextProvider ITextProvider ITextProvider Interface

Exposes methods and properties to support Microsoft UI Automation client access to controls that contain text. Implement this interface in order to support the capabilities that an automation client requests with a GetPattern(Windows.UI.Xaml.Automation.Peers.PatternInterface) call and PatternInterface.

Syntax

Declaration

public interface ITextProviderpublic interface ITextProviderPublic Interface ITextProvider

Remarks

For more info on this pattern, see Text and TextRange Control Patterns.

ITextProvider, ITextProvider2 and ITextRangeProvider aren't implemented by any existing Windows Runtime automation peers using this definition of the interface. The text models supported by Windows Runtime text controls such as TextBox and RichTextBlock do implement some of these patterns, but do so at a native level that doesn't appear in the Windows Runtime definitions of the API surface. For more info, see the peer classes for the various Windows Runtime text controls.

The Microsoft UI Automation interfaces within the Windows Runtime API exist so that custom control authors can support the automation pattern in a custom control, and implement their automation support using the same Windows Runtime managed or C++ API as they use to define control logic or other automation support.

The ITextProvider pattern doesn't have a Windows Runtime property identifier class.

Properties summary

Gets a text range that encloses the main text of a document.

Gets a value that specifies whether a text provider supports selection, and if it does, the type of selection that is supported.

Methods summary

Retrieves a collection of disjoint text ranges that are associated with the current text selection or selections.

Retrieves an array of disjoint text ranges from a text container. Each text range begins with the first partially visible line and ends with the last partially visible line.

Retrieves a text range that encloses a child element, such as an image, hyperlink, or other embedded object.

Retrieves a text range from the vicinity of a screen coordinate.

Properties

  • DocumentRange
    DocumentRange
    DocumentRange
    DocumentRange

    Gets a text range that encloses the main text of a document.

    public ITextRangeProvider DocumentRange { get; }public ITextRangeProvider DocumentRange { get; }Public ReadOnly Property DocumentRange As ITextRangeProvider

    Property Value

  • SupportedTextSelection
    SupportedTextSelection
    SupportedTextSelection
    SupportedTextSelection

    Gets a value that specifies whether a text provider supports selection, and if it does, the type of selection that is supported.

    public SupportedTextSelection SupportedTextSelection { get; }public SupportedTextSelection SupportedTextSelection { get; }Public ReadOnly Property SupportedTextSelection As SupportedTextSelection

    Property Value

Methods

  • GetSelection()
    GetSelection()
    GetSelection()
    GetSelection()

    Retrieves a collection of disjoint text ranges that are associated with the current text selection or selections.

    public ITextRangeProvider[] GetSelection()public ITextRangeProvider[] GetSelection()Public Function GetSelection() As ITextRangeProvider[]

    Returns

    • Windows.UI.Xaml.Automation.Provider.ITextRangeProvider[]
      Windows.UI.Xaml.Automation.Provider.ITextRangeProvider[]
      Windows.UI.Xaml.Automation.Provider.ITextRangeProvider[]

      A collection of disjoint text ranges.

  • GetVisibleRanges()
    GetVisibleRanges()
    GetVisibleRanges()
    GetVisibleRanges()

    Retrieves an array of disjoint text ranges from a text container. Each text range begins with the first partially visible line and ends with the last partially visible line.

    public ITextRangeProvider[] GetVisibleRanges()public ITextRangeProvider[] GetVisibleRanges()Public Function GetVisibleRanges() As ITextRangeProvider[]

    Returns

    • Windows.UI.Xaml.Automation.Provider.ITextRangeProvider[]
      Windows.UI.Xaml.Automation.Provider.ITextRangeProvider[]
      Windows.UI.Xaml.Automation.Provider.ITextRangeProvider[]

      The collection of visible text ranges within a container or an empty array. This method never returns null.

  • RangeFromChild(Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple)
    RangeFromChild(Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple)
    RangeFromChild(Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple)
    RangeFromChild(Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple)

    Retrieves a text range that encloses a child element, such as an image, hyperlink, or other embedded object.

    public ITextRangeProvider RangeFromChild(Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple childElement)public ITextRangeProvider RangeFromChild(Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple childElement)Public Function RangeFromChild(childElement As Windows.UI.Xaml.Automation.Provider.IRawElementProviderSimple) As ITextRangeProvider

    Parameters

    Returns

  • RangeFromPoint(Windows.Foundation.Point)
    RangeFromPoint(Windows.Foundation.Point)
    RangeFromPoint(Windows.Foundation.Point)
    RangeFromPoint(Windows.Foundation.Point)

    Retrieves a text range from the vicinity of a screen coordinate.

    public ITextRangeProvider RangeFromPoint(Windows.Foundation.Point screenLocation)public ITextRangeProvider RangeFromPoint(Windows.Foundation.Point screenLocation)Public Function RangeFromPoint(screenLocation As Windows.Foundation.Point) As ITextRangeProvider

    Parameters

    Returns

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.UI.Xaml.Automation.Provider.dll