Compartir a través de


InkAnalyzerBase.GetTextRangeFromNodes (Método)

Actualización: noviembre 2007

Busca el intervalo de texto de la cadena reconocida que corresponde a una colección de nodos de contexto.

Espacio de nombres:  System.Windows.Ink.AnalysisCore
Ensamblado:  IACore (en IACore.dll)

Sintaxis

'Declaración
Public Sub GetTextRangeFromNodes ( _
    nodesToSearch As ContextNodeBaseCollection, _
    <OutAttribute> ByRef start As Integer, _
    <OutAttribute> ByRef length As Integer _
)
'Uso
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
)

Parámetros

  • start
    Tipo: System.Int32%
    Cuando este método finaliza, el parámetro start contiene un entero de 32 bits con signo que indica el comienzo del intervalo de texto. Este parámetro se pasa sin inicializar.
  • length
    Tipo: System.Int32%
    Cuando este método finaliza, el parámetro length contiene un entero de 32 bits con signo que indica la longitud del intervalo de texto. Este parámetro se pasa sin inicializar.

Comentarios

Si nodesToSearch contiene objetos ContextNodeBase que no son consecutivos, este método devuelve el intervalo de texto más pequeño que abarca todos los nodos de contexto.

Este método inicia una excepción System.ArgumentException cuando nodesToSearch contiene un nodo de contexto que no está asociado al objeto InkAnalyzerBase.

Ejemplos

En el ejemplo siguiente, se recupera el intervalo de texto para el primer nodo de línea de 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);
}

Plataformas

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

Información de versión

.NET Framework

Compatible con: 3.0

Vea también

Referencia

InkAnalyzerBase (Clase)

InkAnalyzerBase (Miembros)

System.Windows.Ink.AnalysisCore (Espacio de nombres)

InkAnalyzerBase.GetNodesFromTextRange