MatchesCriteriaBaseCallback - делегат
Обновлен: Ноябрь 2007
Represents a function that is used to evaluate if a ContextNodeBase object meets or fails a specified criteria.
Пространство имен: System.Windows.Ink.AnalysisCore
Сборка: IACore (в IACore.dll)
Синтаксис
'Декларация
Public Delegate Function MatchesCriteriaBaseCallback ( _
visitingNode As ContextNodeBase, _
data As Object _
) As Boolean
'Применение
Dim instance As New MatchesCriteriaBaseCallback(AddressOf HandlerMethod)
public delegate bool MatchesCriteriaBaseCallback(
ContextNodeBase visitingNode,
Object data
)
public delegate bool MatchesCriteriaBaseCallback(
ContextNodeBase^ visitingNode,
Object^ data
)
/** @delegate */
public delegate boolean MatchesCriteriaBaseCallback(
ContextNodeBase visitingNode,
Object data
)
JScript не поддерживает делегаты.
Параметры
- visitingNode
Тип: System.Windows.Ink.AnalysisCore.ContextNodeBase
The ContextNodeBase object that will be checked against the criteria.
- data
Тип: System.Object
Optional data that can be used for the criteria.
Возвращаемое значение
Тип: 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.
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);
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 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);
}
Платформы
Windows Vista, Windows XP с пакетом обновления 2 (SP2), Windows Server 2003
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0