InkAnalyzer.FindNodes - метод (MatchesCriteriaCallback, Object, ContextNode)
Обновлен: Ноябрь 2007
Returns a ContextNodeCollection containing the ContextNode objects that are descendants of the specified ContextNode and that match the specified criteria.
Пространство имен: System.Windows.Ink
Сборка: IAWinFX (в IAWinFX.dll)
Синтаксис
'Декларация
Public Function FindNodes ( _
criteria As MatchesCriteriaCallback, _
data As Object, _
nodeToSearch As ContextNode _
) As ContextNodeCollection
'Применение
Dim instance As InkAnalyzer
Dim criteria As MatchesCriteriaCallback
Dim data As Object
Dim nodeToSearch As ContextNode
Dim returnValue As ContextNodeCollection
returnValue = instance.FindNodes(criteria, _
data, nodeToSearch)
public ContextNodeCollection FindNodes(
MatchesCriteriaCallback criteria,
Object data,
ContextNode nodeToSearch
)
public:
ContextNodeCollection^ FindNodes(
MatchesCriteriaCallback^ criteria,
Object^ data,
ContextNode^ nodeToSearch
)
public ContextNodeCollection FindNodes(
MatchesCriteriaCallback criteria,
Object data,
ContextNode nodeToSearch
)
public function FindNodes(
criteria : MatchesCriteriaCallback,
data : Object,
nodeToSearch : ContextNode
) : ContextNodeCollection
Параметры
- criteria
Тип: System.Windows.Ink.MatchesCriteriaCallback
- data
Тип: System.Object
- nodeToSearch
Тип: System.Windows.Ink.ContextNode
The ContextNode whose descendants are searched.
Возвращаемое значение
Тип: System.Windows.Ink.ContextNodeCollection
A ContextNodeCollection containing all of the ContextNode objects that are descendants of the specified node and match the specified criteria.
Примеры
The following example finds the collection of ContextNode objects in an InkAnalyzer named 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 WritingRegionNode named writingRegion.
Dim isLineLowerThanCallback As New MatchesCriteriaCallback(AddressOf LineIsLowerThan)
Dim nodesInRegionBelowYValue As ContextNodeCollection = _
theInkAnalyzer.FindNodes(isLineLowerThanCallback, yValue, writingRegion)
MatchesCriteriaCallback
isLineLowerThanCallback = new MatchesCriteriaCallback(LineIsLowerThan);
ContextNodeCollection nodesInRegionBelowYValue =
theInkAnalyzer.FindNodes(isLineLowerThanCallback, yValue, writingRegion);
The following example defines the LineIsLowerThan method, which returns true if the ContextNode is a [T:System.Windows.Ink.LineNode,] and if the bottom of the bounding box is lower than the integer that is passed in. (Note that coordinates are expressed in relation to the top left corner of the window: the more you move down, the higher the y-coordinate.) Therefore, the nodesBelowYValue collection contains all lines with strokes below the value, yValue.
Public Function LineIsLowerThan(ByVal node As ContextNode, ByVal data As Object) As Boolean
' Return false if not a line
If Not TypeOf node Is LineNode Then
Return False
End If
' Check if bottom is lower than yValue passed in
Dim yValue As Double = System.Convert.ToDouble(data)
Return node.Location.GetBounds().Bottom > yValue
End Function 'LineIsLowerThan
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 Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0