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文本范围距离文档开头的偏移量。
length
类型:System.Int64文本范围的长度。
kind
类型:System.Int32文本范围的种类。有关如何使用此参数的说明,请参见 TextRange.Kind 属性。
返回值
类型:Microsoft.Windows.Design.SourceUpdate.TextRange
指定的位置、长度和种类的一个新的唯一 TextRange。
备注
TextRange 实例是唯一的,而且将在与 TextRangeManager 相关联的文档发生更改时保持最新。只要调用 TextAdded 和 TextRemoved 方法并且/或者使用 ISourceChanger 和 ISourceReader 包装,这些更改就会保持最新。
除非 TextRangeManager 引用的文本已被删除,否则使用此方法创建的文本范围将一直存在。
权限
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
另请参见
参考
Microsoft.Windows.Design.SourceUpdate 命名空间