Share via


InkAnalyzerBase.FindNodes Method (MatchesCriteriaBaseCallback, Object)

Returns all of the ContextNodeBase objects that match the specified criteria.

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

Syntax

'Declaration
Public Function FindNodes ( _
    criteria As MatchesCriteriaBaseCallback, _
    data As Object _
) As ContextNodeBaseCollection
'Usage
Dim instance As InkAnalyzerBase 
Dim criteria As MatchesCriteriaBaseCallback 
Dim data As Object 
Dim returnValue As ContextNodeBaseCollection 

returnValue = instance.FindNodes(criteria, _
    data)
public ContextNodeBaseCollection FindNodes(
    MatchesCriteriaBaseCallback criteria,
    Object data
)
public:
ContextNodeBaseCollection^ FindNodes(
    MatchesCriteriaBaseCallback^ criteria, 
    Object^ data
)
public function FindNodes(
    criteria : MatchesCriteriaBaseCallback, 
    data : Object
) : ContextNodeBaseCollection

Parameters

  • data
    Type: System.Object

    Optional extra data that may be passed into the delegate function. This method passes this data to the delegate with each call and does not modify or examine it.

Return Value

Type: System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
A ContextNodeBaseCollection containing all of the ContextNodeBase objects that match the specified criteria.

Examples

The following example finds the collection of ContextNodeBase objects in an InkAnalyzerBase, theInkAnalyzerBase, that satisfies the criteria specified in the MatchesCriteriaBaseCallback delegate function LineIsLowerThan by using an integer, yValue.

Dim lineIsLowerThanCallback As _
    New System.Windows.Ink.AnalysisCore.MatchesCriteriaBaseCallback(AddressOf LineIsLowerThan)
Dim nodesBelowYValue As ContextNodeBaseCollection = _
    theInkAnalyzerBase.FindNodes(lineIsLowerThanCallback, yValue)
System.Windows.Ink.AnalysisCore.MatchesCriteriaBaseCallback
    lineIsLowerThanCallback = new System.Windows.Ink.AnalysisCore.MatchesCriteriaBaseCallback(LineIsLowerThan);
ContextNodeBaseCollection nodesBelowYValue =
    theInkAnalyzerBase.FindNodes(lineIsLowerThanCallback, yValue);

The following example defines the LineIsLowerThan method, which returns true if the ContextNodeBase is of type Line and if the bottom of the bounding box is lower than an integer that is passed in. (Remember that higher y values appear lower on the screen.) Therefore, the nodesBelowYValue collection contains all lines with strokes below the value, yValue.

Public Function LineIsLowerThan( _
    ByVal nodeBase As System.Windows.Ink.AnalysisCore.ContextNodeBase, _
    ByVal data As Object) As Boolean 

    ' Return false if not a line 
    If nodeBase.Type <> System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line Then 
        Return False 
    End If 
    ' Check if bottom is lower than yValue passed in 
    Dim yValue As Integer = Fix(data)
    Return nodeBase.Location.GetBounds()(3) > yValue

End Function 'LineIsLowerThan
public bool LineIsLowerThan(System.Windows.Ink.AnalysisCore.ContextNodeBase nodeBase, object data)
{
    // Return false if not a line 
    if (!(nodeBase.Type == System.Windows.Ink.AnalysisCore.ContextNodeTypeBase.Line))
        return false;

    // Check if bottom is lower than yValue passed in 
    int yValue = (int)data;
    return (nodeBase.Location.GetBounds()[3] > yValue);

}

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

FindNodes Overload

System.Windows.Ink.AnalysisCore Namespace