MatchesCriteriaCallback Delegate

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

Namespace: System.Windows.Ink
Assembly: IAWinFX (in iawinfx.dll)

public delegate bool MatchesCriteriaCallback (
	ContextNode visitingNode,
	Object data
/** @delegate */
public delegate boolean MatchesCriteriaCallback (
	ContextNode visitingNode, 
	Object data
Not applicable.



The ContextNode object that will be checked against the criteria.


Optional data that can be used for the criteria.

Return Value

Whether the visitingNode object matches the criteria.

The following example finds the collection of ContextNode objects in an InkAnalyzer, theInkAnalyzer, that satisfies the criteria specified in the MatchesCriteriaCallBack delegate function, LineIsLowerThan, by using an integer, yValue.

    lineIsLowerThanCallback = new MatchesCriteriaCallback(LineIsLowerThan);
ContextNodeCollection nodesBelowYValue =
    theInkAnalyzer.FindNodes(lineIsLowerThanCallback, yValue);

LineIsLowerThan returns a true if the ContextNode is a LineNode and if the bottom of the bounding box is lower than an integer that is passed in. Therefore, the nodesBelowYValue collection contains all lines with strokes below the value, yValue. Remember that higher y values appear lower on the screen.

public bool LineIsLowerThan(ContextNode node, object data)
    // Return false if not a line
    if (!(node is LineNode))
        return false;

    // Check if bottom is lower than yValue passed in
    double yValue = (double)data;
    return (node.Location.GetBounds().Bottom > yValue);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0