InkAnalyzerBase.FindNodes - метод (MatchesCriteriaBaseCallback, Object, ContextNodeBase)
Обновлен: Ноябрь 2007
Returns the ContextNode objects that are descendants of the specified ContextNode and that match the specified criteria.
Пространство имен: System.Windows.Ink.AnalysisCore
Сборка: IACore (в IACore.dll)
Синтаксис
'Декларация
Public Function FindNodes ( _
criteria As MatchesCriteriaBaseCallback, _
data As Object, _
nodeToSearch As ContextNodeBase _
) As ContextNodeBaseCollection
'Применение
Dim instance As InkAnalyzerBase
Dim criteria As MatchesCriteriaBaseCallback
Dim data As Object
Dim nodeToSearch As ContextNodeBase
Dim returnValue As ContextNodeBaseCollection
returnValue = instance.FindNodes(criteria, _
data, nodeToSearch)
public ContextNodeBaseCollection FindNodes(
MatchesCriteriaBaseCallback criteria,
Object data,
ContextNodeBase nodeToSearch
)
public:
ContextNodeBaseCollection^ FindNodes(
MatchesCriteriaBaseCallback^ criteria,
Object^ data,
ContextNodeBase^ nodeToSearch
)
public ContextNodeBaseCollection FindNodes(
MatchesCriteriaBaseCallback criteria,
Object data,
ContextNodeBase nodeToSearch
)
public function FindNodes(
criteria : MatchesCriteriaBaseCallback,
data : Object,
nodeToSearch : ContextNodeBase
) : ContextNodeBaseCollection
Параметры
- criteria
Тип: System.Windows.Ink.AnalysisCore.MatchesCriteriaBaseCallback
A delegate function that determines if a ContextNodeBase object meets or fails its specified criteria.
- data
Тип: 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.
- nodeToSearch
Тип: System.Windows.Ink.AnalysisCore.ContextNodeBase
The ContextNode whose descendants are searched.
Возвращаемое значение
Тип: System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
A ContextNodeBaseCollection containing all of the ContextNodeBase objects that match the specified criteria.
Примеры
The following example finds the collection of ContextNodeBase objects in an InkAnalyzerBase, theInkAnalyzer, that satisfy the criteria specified in the LineIsLowerThan delegate. The 32-bit signed integer, yValue, is passed to the LineIsLowerThan delegate. The search is confined to the descendants of the ContextNodeBase, writingRegion.
Dim isLineLowerThanCallback As _
New Microsoft.Ink.MatchesCriteriaCallback(AddressOf LineIsLowerThan)
Dim nodesInRegionBelowYValue As ContextNodeCollection = _
theInkAnalyzer.FindNodes(isLineLowerThanCallback, yValue, writingRegion)
Microsoft.Ink.MatchesCriteriaCallback
isLineLowerThanCallback = new Microsoft.Ink.MatchesCriteriaCallback(LineIsLowerThan);
ContextNodeCollection nodesInRegionBelowYValue =
theInkAnalyzer.FindNodes(isLineLowerThanCallback, yValue, writingRegion);
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);
}
Платформы
Windows Vista, Windows XP с пакетом обновления 2 (SP2), Windows Server 2003
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0