Expand Minimize

MatchesCriteriaBaseCallback Delegate

Represents a function that is used to evaluate if a ContextNodeBase object meets or fails a specified criteria.

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

public delegate bool MatchesCriteriaBaseCallback(
	ContextNodeBase visitingNode,
	Object data


Type: System.Windows.Ink.AnalysisCore.ContextNodeBase

The ContextNodeBase object that will be checked against the criteria.

Type: System.Object

Optional data that can be used for the criteria.

Return Value

Type: System.Boolean
A Boolean value which indicates whether the visitingNode object matches the criteria.

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.

    lineIsLowerThanCallback = new System.Windows.Ink.AnalysisCore.MatchesCriteriaBaseCallback(LineIsLowerThan);
ContextNodeBaseCollection nodesBelowYValue =
    theInkAnalyzerBase.FindNodes(lineIsLowerThanCallback, yValue);

LineIsLowerThan returns a 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 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);


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.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft