Export (0) Print
Expand All

TreeWalker::Normalize Method (AutomationElement, CacheRequest)

Retrieves the node itself, if it satisfies the Condition, or the nearest parent or ancestor node that satisfies the Condition, and caches properties and patterns.

Namespace:  System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

public:
AutomationElement^ Normalize(
	AutomationElement^ element, 
	CacheRequest^ request
)

Parameters

element
Type: System.Windows.Automation::AutomationElement

The element from which to start the normalization.

request
Type: System.Windows.Automation::CacheRequest

A cache request object specifying properties and patterns on the returned AutomationElement to cache.

Return Value

Type: System.Windows.Automation::AutomationElement
The nearest AutomationElement in the current view. If the navigation up the ancestor chain reaches the root element, the root element is returned.

The element is normalized by navigating up the ancestor chain in the tree until an element that satisfies the view condition for the TreeWalker object is reached. If the root element is reached, the root element is returned even if it does not satisfy the view condition.

This method is useful for applications that obtain references to UI Automation elements by hit-testing. The application might want to work only with specific types of elements, and can use Normalize to make sure that no matter what element is initially retrieved (for example, when a scroll bar gets the input focus), only the element of interest (such as a content element) is ultimately retrieved.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft