Condividi tramite


Proprietà AnalysisAlternateBase.AlternateNodes

Aggiornamento: novembre 2007

Ottiene gli oggetti ContextNodeBase associati a questa alternativa.

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

Sintassi

'Dichiarazione
Public ReadOnly Property AlternateNodes As ContextNodeBaseCollection
'Utilizzo
Dim instance As AnalysisAlternateBase
Dim value As ContextNodeBaseCollection

value = instance.AlternateNodes
public ContextNodeBaseCollection AlternateNodes { get; }
public:
property ContextNodeBaseCollection^ AlternateNodes {
    ContextNodeBaseCollection^ get ();
}
/** @property */
public ContextNodeBaseCollection get_AlternateNodes()
public function get AlternateNodes () : ContextNodeBaseCollection

Valore proprietà

Tipo: System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
Oggetti ContextNodeBase associati a questa alternativa.

Note

Poiché corrispondono ad alternative, questi oggetti ContextNodeBase non sono discendenti di RootNode di InkAnalyzerBase, a meno che non siano la prima alternativa, ovvero il primo elemento in AnalysisAlternateBaseCollection.

Esempi

Nell'esempio seguente viene determinato se un oggetto AnalysisAlternateBase, selectedAlternate, presenta la stessa segmentazione della prima alternativa in AnalysisAlternateBaseCollection, currentAlternates. Per segmentazione si intende il modo in cui i tratti vengono separati in oggetti ContextNodeBase.

Dim hasSameSegmentationAsTop As Boolean = True
If currentAlternates.Count > 0 Then
    Dim topAlternate As AnalysisAlternateBase = currentAlternates(0)
    ' First check if selected alternate is the top alternate
    If selectedAlternate.Equals(topAlternate) Then
        hasSameSegmentationAsTop = True
    Else
        ' Check to see if they have the same strokes
        If topAlternate.AlternateNodes.Count <> selectedAlternate.AlternateNodes.Count Then
            hasSameSegmentationAsTop = False
        Else
            ' Check that each node matches the alternates
            For index As Integer = 0 To topAlternate.AlternateNodes.Count - 1

                Dim selectedAlternateNodesStrokes As Strokes = _
                    theInk.CreateStrokes(selectedAlternate.AlternateNodes(index).GetStrokeIds())

                Dim topAlternateNodesStrokes As Strokes = _
                        theInk.CreateStrokes(topAlternate.AlternateNodes(index).GetStrokeIds())

                For Each topStroke As Stroke In topAlternateNodesStrokes
                    If (Not selectedAlternateNodesStrokes.Contains(topStroke)) Then
                        hasSameSegmentationAsTop = False
                        Exit For
                    End If
                Next topStroke

            Next index

        End If

    End If

End If
bool hasSameSegmentationAsTop = true;
if (currentAlternates.Count > 0)
{
    AnalysisAlternateBase topAlternate = currentAlternates[0];
    // First check if selected alternate is the top alternate
    if (selectedAlternate == topAlternate)
    {
        hasSameSegmentationAsTop = true;
    }
    else
    {
        // Check to see if they have the same strokes
        if (topAlternate.AlternateNodes.Count != selectedAlternate.AlternateNodes.Count)
        {
            hasSameSegmentationAsTop = false;
        }
        else
        {
            // Check that each node matches the alternates
            for (int i = 0; i < topAlternate.AlternateNodes.Count; i++)
            {
                Strokes selectedAlternateNodesStrokes =
                    theInk.CreateStrokes(selectedAlternate.AlternateNodes[i].GetStrokeIds());
                Strokes topAlternateNodesStrokes =
                    theInk.CreateStrokes(topAlternate.AlternateNodes[i].GetStrokeIds());

                foreach (Stroke stroke in topAlternateNodesStrokes)
                {
                    if (!selectedAlternateNodesStrokes.Contains(stroke))
                    {
                        hasSameSegmentationAsTop = false;
                        break;
                    }
                }
            }
        }
    }
}

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

AnalysisAlternateBase Classe

Membri AnalysisAlternateBase

Spazio dei nomi System.Windows.Ink.AnalysisCore