ITextProvider 介面

定義

公開方法和屬性,以支援 Microsoft UI 自動化用戶端對包含文字之控制項的存取。 實作此介面,以支援自動化用戶端使用 GetPattern 呼叫和 PatternInterface.Text要求的功能。

public interface class ITextProvider
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(3680222367, 18439, 20266, 134, 120, 27, 19, 243, 198, 14, 34)]
struct ITextProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(3680222367, 18439, 20266, 134, 120, 27, 19, 243, 198, 14, 34)]
public interface ITextProvider
Public Interface ITextProvider
衍生
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

如需此模式的詳細資訊,請參閱 文字和 TextRange 控制項模式

ITextProvider、ITextProvider2ITextRangeProvider不會由任何使用介面定義的現有Windows 執行階段自動化對等實作。 Windows 執行階段TextBoxRichTextBlock等文字控制項所支援的文字模型會實作其中一些模式,但在 API 介面的Windows 執行階段定義中不會顯示這類模式的原生層級執行此動作。 如需詳細資訊,請參閱各種Windows 執行階段文字控制項的對等類別。

Windows 執行階段 API 內的 Microsoft UI 自動化介面存在,因此自訂控制項作者可以在自訂控制項中支援自動化模式,並使用與用來定義控制項邏輯或其他自動化支援相同的Windows 執行階段 Managed 或 C++ API 來實作其自動化支援。

ITextProvider 模式沒有Windows 執行階段屬性識別碼類別。

屬性

DocumentRange

取得包含文件主要文字的文字範圍。

SupportedTextSelection

取得值,這個值會指定文字提供者是否支援選取範圍,如果是,則為支援的選取範圍類型。

方法

GetSelection()

擷取與目前文字選取範圍或選取範圍相關聯的脫離文字範圍集合。

GetVisibleRanges()

從文字容器擷取脫離文字範圍的陣列。 每個文字範圍都是以第一個部分可見的行開始,並以最後一個部分可見的行結尾。

RangeFromChild(IRawElementProviderSimple)

擷取包含子專案的文字範圍,例如影像、超連結或其他内嵌物件。

RangeFromPoint(Point)

從螢幕座標附近擷取文字範圍。

適用於

另請參閱