InkAnalyzerBase.GetTextRangeFromNodes 方法

查找已识别字符串中对应于上下文节点集合的文本范围。

命名空间:  System.Windows.Ink.AnalysisCore
程序集:  IACore(在 IACore.dll 中)

语法

声明
Public Sub GetTextRangeFromNodes ( _
    nodesToSearch As ContextNodeBaseCollection, _
    <OutAttribute> ByRef start As Integer, _
    <OutAttribute> ByRef length As Integer _
)
用法
Dim instance As InkAnalyzerBase
Dim nodesToSearch As ContextNodeBaseCollection
Dim start As Integer
Dim length As Integer

instance.GetTextRangeFromNodes(nodesToSearch, _
    start, length)
public void GetTextRangeFromNodes(
    ContextNodeBaseCollection nodesToSearch,
    out int start,
    out int length
)
public:
void GetTextRangeFromNodes(
    ContextNodeBaseCollection^ nodesToSearch, 
    [OutAttribute] int% start, 
    [OutAttribute] int% length
)
public void GetTextRangeFromNodes(
    ContextNodeBaseCollection nodesToSearch,
    /** @attribute OutAttribute */ /** @ref */int start,
    /** @attribute OutAttribute */ /** @ref */int length
)
public function GetTextRangeFromNodes(
    nodesToSearch : ContextNodeBaseCollection, 
    start : int, 
    length : int
)

参数

  • start
    类型:System.Int32%
    此方法返回时,start 参数包含指示文本范围起点的 32 位有符号整数。该参数未经初始化即被传递。
  • length
    类型:System.Int32%
    此方法返回时,length 参数包含指示文本范围长度的 32 位有符号整数。该参数未经初始化即被传递。

备注

如果 nodesToSearch 包含不连续的 ContextNodeBase 对象,则此方法返回涵盖所有上下文节点的最小文本范围。

如果 nodesToSearch 包含不与 InkAnalyzerBase 关联的上下文节点,则此方法引发 System.ArgumentException

示例

下面的示例检索 InkAnalyzerBase (theInkAnalyzerBase) 的第一个行节点的文本范围。

' Get all line nodes.
Dim theLineNodes As System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection = _
    theInkAnalyzerBase.FindNodesOfType( _
        System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line)

' Remove all but the first line node.
If 0 < theLineNodes.Count Then
    Dim firstLineNode As System.Windows.Ink.AnalysisCore.ContextNodeBase = theLineNodes(0)
    theLineNodes.Clear()
    theLineNodes.Add(firstLineNode)
End If

' Get the text range for the first line node.
Dim selectionStart As Integer = 0
Dim selectionLength As Integer = 0
If 0 < theLineNodes.Count Then
    theInkAnalyzerBase.GetTextRangeFromNodes( _
        theLineNodes, selectionStart, selectionLength)
End If
// Get all line nodes.
System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection theLineNodes =
    theInkAnalyzerBase.FindNodesOfType(
        System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line);

// Remove all but the first line node.
if (0 < theLineNodes.Count)
{
    System.Windows.Ink.AnalysisCore.ContextNodeBase firstLineNode = theLineNodes[0];
    theLineNodes.Clear();
    theLineNodes.Add(firstLineNode);
}

// Get the text range for the first line node.
int selectionStart = 0;
int selectionLength = 0;
if (0 < theLineNodes.Count)
{
    theInkAnalyzerBase.GetTextRangeFromNodes(
        theLineNodes, out selectionStart, out selectionLength);
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkAnalyzerBase 类

InkAnalyzerBase 成员

System.Windows.Ink.AnalysisCore 命名空间

InkAnalyzerBase.GetNodesFromTextRange