Share via


Metodo InkAnalyzerBase.GetTextRangeFromNodes

Aggiornamento: novembre 2007

Trova l'intervallo di testo nella stringa riconosciuta corrispondente a un insieme di nodi di contesto.

Spazio dei nomi:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Sintassi

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

Parametri

  • start
    Tipo: System.Int32%
    Alla restituzione di questo metodo, il parametro start contiene un valore integer con segno a 32 bit che indica l'inizio dell'intervallo di testo. Questo parametro viene passato senza inizializzazione.
  • length
    Tipo: System.Int32%
    Alla restituzione di questo metodo, il parametro length contiene un valore integer con segno a 32 bit che indica la lunghezza dell'intervallo di testo. Questo parametro viene passato senza inizializzazione.

Note

Se il parametro nodesToSearch contiene oggetti ContextNodeBase non consecutivi, questo metodo restituisce l'intervallo di testo più piccolo in cui rientrano tutti i nodi di contesto.

Questo metodo genera un'eccezione System.ArgumentException quando nodesToSearch contiene un nodo di contesto non associato a InkAnalyzerBase.

Esempi

Nell'esempio seguente viene recuperato l'intervallo di testo per il primo nodo riga di 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);
}

Piattaforme

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Framework

Supportato in: 3.0

Vedere anche

Riferimenti

InkAnalyzerBase Classe

Membri InkAnalyzerBase

Spazio dei nomi System.Windows.Ink.AnalysisCore

InkAnalyzerBase.GetNodesFromTextRange