Version

ContinueDescendantSearch Method (UIElement)

This method is called from GetDescendant(Type) as an optimization to prevent searching down element paths that can't possibly contain the element that is being searched for.
Syntax
'Declaration
 
Protected Overridable Function ContinueDescendantSearch( _
   ByVal type As Type, _
   ByVal contexts() As Object _
) As Boolean
protected virtual bool ContinueDescendantSearch( 
   Type type,
   object[] contexts
)

Parameters

type
The System.Type (or base class type) of the UIElement to look for.
contexts
The contexts that must all match with the contexts of the UIElement.

Return Value

True if there is any possiblity that the element being sought is a descendant of this element. If this method returns false then descendant elements of this element will be excluded from the search.
Remarks

The default implementation does not make use of the type parameter. It will always return true except if this element has a PrimaryContext and its type matches the type of one of the passed in contexts but the context objects are't the same.

For example, if the search was for a CellUIElement in an UltraGrid control and this is a RowUIElement and its PrimaryContext is its corresponding UltraGridRow object and one of the contexts passed in was of type UltraGridRow but was a different UltraGridRow then we could safely ignore all descendant elements of this other row since the cell we are searching for couldn't possibly be a descendant.

However, if the is of type System.DateTime then the default implementation will always return true. This is because it can't make any assumptions based on equality since the significance of the DateTime context could be its date portion, its time portion or both.

This method is normally overridden by classes that override the GetContext(Type) method or that can provide additional optimizations based on the type or contexts.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also