Export (0) Print
Expand All

TreeWalker Class

Provides methods and properties used to navigate the UI Automation tree.

System.Object
  System.Windows.Automation.TreeWalker

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

public sealed class TreeWalker

The TreeWalker type exposes the following members.

  NameDescription
Public methodTreeWalkerInitializes a new instance of the TreeWalker class.
Top

  NameDescription
Public propertyConditionGets the object that defines the view for the TreeWalker object.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetFirstChild(AutomationElement)Retrieves the first child element of the specified AutomationElement.
Public methodGetFirstChild(AutomationElement, CacheRequest)Retrieves the first child element of the specified AutomationElement and caches properties and patterns.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetLastChild(AutomationElement)Retrieves the last child element of the specified AutomationElement.
Public methodGetLastChild(AutomationElement, CacheRequest)Retrieves the last child element of the specified AutomationElement and caches properties and patterns.
Public methodGetNextSibling(AutomationElement) Retrieves the next sibling element of the specified AutomationElement.
Public methodGetNextSibling(AutomationElement, CacheRequest)Retrieves the next sibling element of the specified AutomationElement and caches properties and patterns.
Public methodGetParent(AutomationElement)Retrieves the parent element of the specified AutomationElement.
Public methodGetParent(AutomationElement, CacheRequest)Retrieves the parent element of the specified AutomationElement and caches properties and patterns.
Public methodGetPreviousSibling(AutomationElement)Retrieves the previous sibling of the specified AutomationElement.
Public methodGetPreviousSibling(AutomationElement, CacheRequest)Retrieves the previous sibling of the specified AutomationElement and caches properties and patterns.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodNormalize(AutomationElement)Retrieves the node itself, if it satisfies the Condition, or the nearest parent or ancestor node that satisfies the Condition.
Public methodNormalize(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.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public fieldStatic memberContentViewWalkerRepresents a predefined TreeWalker containing a view of elements in the tree that are marked as content controls.
Public fieldStatic memberControlViewWalkerRepresents a predefined TreeWalker containing a view of elements in the tree that are marked as controls.
Public fieldStatic memberRawViewWalkerRepresents a predefined TreeWalker containing a view of all the elements in the tree.
Top

UI Automation clients view the UI Automation elements on the desktop as a set of AutomationElement objects arranged in a tree structure.

Using the TreeWalker class, a client application can navigate the UI Automation tree by selecting a view of the tree and stepping from one AutomationElement to another in a specified direction using the GetFirstChild, GetLastChild, GetPreviousSibling, GetNextSibling, and GetParent methods.

Navigating the UI Automation tree using TreeWalker can result in cross-process calls and is not as efficient as locating an element using the FindAll or FindFirst methods.

If your client application might try to find elements in its own user interface, you must make all UI Automation calls on a separate thread.

.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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft