Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MatchesCriteriaCallback Delegate
Collapse the table of content
Expand the table of content

MatchesCriteriaCallback Delegate

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

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

public delegate bool MatchesCriteriaCallback(
	ContextNode visitingNode,
	Object data


Type: Microsoft.Ink.ContextNode

The ContextNode 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
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 Microsoft.Ink.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. (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(Microsoft.Ink.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 
			int yValue = (int)data;
			return (node.Location.GetBounds().Bottom > yValue);

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

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

Community Additions

© 2015 Microsoft