Sdílet prostřednictvím


InkAnalyzerBase.FindLeafNodes Method

Returns all of the leaf nodes, which are the ContextNodeBase objects that have no child nodes.

Namespace:  System.Windows.Ink.AnalysisCore
Assembly:  IACore (in IACore.dll)

Syntax

'Declaration
Public Function FindLeafNodes As ContextNodeBaseCollection
'Usage
Dim instance As InkAnalyzerBase 
Dim returnValue As ContextNodeBaseCollection 

returnValue = instance.FindLeafNodes()
public ContextNodeBaseCollection FindLeafNodes()
public:
ContextNodeBaseCollection^ FindLeafNodes()
public function FindLeafNodes() : ContextNodeBaseCollection

Return Value

Type: System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
A ContextNodeBaseCollection that contains all the leaf nodes.

Examples

The following example loops through all the leaf nodes of an InkAnalyzerBase, theInkAnalyzerBase, and finds the one with the lowest lower bound.

' Find the leaf context node that has the lowest bottom bound. 
' In the ink coordinates system a higher value is physically lower. 
Dim lowest As Integer = Integer.MinValue
Dim lowestNode As System.Windows.Ink.AnalysisCore.ContextNodeBase = Nothing 

Dim leafNode As System.Windows.Ink.AnalysisCore.ContextNodeBase
For Each leafNode In theInkAnalyzerBase.FindInkLeafNodes()
    ' Find lowest node. Note, AnalysisRegionBase.GetBounds() returns an 
    ' array containing the left, top, right, and bottom bounds in order. 
    If leafNode.Location.GetBounds()(3) > lowest Then
        lowestNode = leafNode
        lowest = leafNode.Location.GetBounds()(3)
    End If 
Next leafNode
// Find the leaf context node that has the lowest bottom bound. 
// In the ink coordinates system a higher value is physically lower. 
int lowest = int.MinValue;
System.Windows.Ink.AnalysisCore.ContextNodeBase lowestNode = null;
foreach (System.Windows.Ink.AnalysisCore.ContextNodeBase leafNode
    in theInkAnalyzerBase.FindInkLeafNodes())
{
    // Find lowest node. Note, AnalysisRegionBase.GetBounds() returns an 
    // array containing the left, top, right, and bottom bounds in order. 
    if (leafNode.Location.GetBounds()[3] > lowest)
    {
        lowestNode = leafNode;
        lowest = leafNode.Location.GetBounds()[3];
    }
}

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkAnalyzerBase Class

InkAnalyzerBase Members

System.Windows.Ink.AnalysisCore Namespace

InkAnalyzerBase.FindInkLeafNodes

InkAnalyzerBase.FindNode

InkAnalyzerBase.FindNodes

InkAnalyzerBase.FindNodesOfType