ITextRangeProvider 介面

定義

公開方法和屬性,以支援 Microsoft UI 自動化用戶端存取實作 ITextProvider之文字容器中的連續文字範圍。

public interface class ITextRangeProvider
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(41183373, 1769, 20326, 148, 70, 40, 165, 190, 152, 251, 208)]
struct ITextRangeProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(41183373, 1769, 20326, 148, 70, 40, 165, 190, 152, 251, 208)]
public interface ITextRangeProvider
Public Interface ITextRangeProvider
衍生
屬性

Windows 需求

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

備註

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

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

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

方法

AddToSelection()

將 新增至文字容器中醒目提示文字的集合,該容器支援多個脫離選取專案。

Clone()

會傳回與原始ITextRangeProvider 相同的新 ITextRangeProvider,並繼承原始的所有屬性。

Compare(ITextRangeProvider)

傳回值,指出文字範圍的起點和終點是否與另一個文字範圍相同。

CompareEndpoints(TextPatternRangeEndpoint, ITextRangeProvider, TextPatternRangeEndpoint)

傳回值,指出兩個文字範圍是否有相同的端點。

ExpandToEnclosingUnit(TextUnit)

將文字範圍擴展至指定的文字單元。

FindAttribute(Int32, Object, Boolean)

傳回具有指定之屬性識別碼和屬性值的文字範圍子集。

FindText(String, Boolean, Boolean)

傳回包含指定文字的文字範圍子集。

GetAttributeValue(Int32)

擷取文字範圍中指定屬性識別碼的值。

GetBoundingRectangles(Double[])

對文字範圍中每一個完整或部分可見的文字行,擷取週框的集合。

GetChildren()

擷取存在於文字範圍內之所有内嵌物件的集合。

GetEnclosingElement()

傳回括文字範圍的最內部元素。

GetText(Int32)

擷取範圍的純文字。

Move(TextUnit, Int32)

將文字範圍移動指定的文字單元數。

MoveEndpointByRange(TextPatternRangeEndpoint, ITextRangeProvider, TextPatternRangeEndpoint)

將文字範圍的一個端點移至第二個文字範圍上指定的端點。

MoveEndpointByUnit(TextPatternRangeEndpoint, TextUnit, Int32)

在文件範圍內,將文字範圍的一個端點移動指定的文字單元數。

RemoveFromSelection()

從支援多個脫離選取專案之文字容器中反白顯示的文字集合中,移除對應至呼叫端文字範圍端點的醒目提示文字區段。

ScrollIntoView(Boolean)

導致文字控制項垂直捲動,直到在檢視區看到文字範圍為止。

Select()

醒目提示文字控制項中對應至文字範圍的開始和結束端點的文字。

適用於

另請參閱