TextRangeManager.GetTextRange 方法

更新:2007 年 11 月

此 API 支持 .NET Framework 基础结构,不适合在代码中直接使用。

为指定的位置、长度和种类创建一个 TextRange

命名空间:  Microsoft.Windows.Design.SourceUpdate
程序集:  Microsoft.Windows.Design.Markup(在 Microsoft.Windows.Design.Markup.dll 中)

语法

声明
Public Function GetTextRange ( _
    location As Long, _
    length As Long, _
    kind As Integer _
) As TextRange
用法
Dim instance As TextRangeManager
Dim location As Long
Dim length As Long
Dim kind As Integer
Dim returnValue As TextRange

returnValue = instance.GetTextRange(location, _
    length, kind)
public TextRange GetTextRange(
    long location,
    long length,
    int kind
)
public:
TextRange^ GetTextRange(
    long long location, 
    long long length, 
    int kind
)
public function GetTextRange(
    location : long, 
    length : long, 
    kind : int
) : TextRange

参数

  • location
    类型:System.Int64

    文本范围距离文档开头的偏移量。

返回值

类型:Microsoft.Windows.Design.SourceUpdate.TextRange

指定的位置、长度和种类的一个新的唯一 TextRange

备注

TextRange 实例是唯一的,而且将在与 TextRangeManager 相关联的文档发生更改时保持最新。只要调用 TextAddedTextRemoved 方法并且/或者使用 ISourceChangerISourceReader 包装,这些更改就会保持最新。

除非 TextRangeManager 引用的文本已被删除,否则使用此方法创建的文本范围将一直存在。

权限

另请参见

参考

TextRangeManager 类

TextRangeManager 成员

Microsoft.Windows.Design.SourceUpdate 命名空间

其他资源

WPF 设计器扩展性