TreeWalker Class
Provides methods and properties used to navigate the UI Automation tree.
Namespace: System.Windows.Automation
Assembly: UIAutomationClient (in UIAutomationClient.dll)
The TreeWalker type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | GetFirstChild(AutomationElement) | Retrieves the first child element of the specified AutomationElement. |
![]() | GetFirstChild(AutomationElement, CacheRequest) | Retrieves the first child element of the specified AutomationElement and caches properties and patterns. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLastChild(AutomationElement) | Retrieves the last child element of the specified AutomationElement. |
![]() | GetLastChild(AutomationElement, CacheRequest) | Retrieves the last child element of the specified AutomationElement and caches properties and patterns. |
![]() | GetNextSibling(AutomationElement) | Retrieves the next sibling element of the specified AutomationElement. |
![]() | GetNextSibling(AutomationElement, CacheRequest) | Retrieves the next sibling element of the specified AutomationElement and caches properties and patterns. |
![]() | GetParent(AutomationElement) | Retrieves the parent element of the specified AutomationElement. |
![]() | GetParent(AutomationElement, CacheRequest) | Retrieves the parent element of the specified AutomationElement and caches properties and patterns. |
![]() | GetPreviousSibling(AutomationElement) | Retrieves the previous sibling of the specified AutomationElement. |
![]() | GetPreviousSibling(AutomationElement, CacheRequest) | Retrieves the previous sibling of the specified AutomationElement and caches properties and patterns. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | Normalize(AutomationElement) | Retrieves the node itself, if it satisfies the Condition, or the nearest parent or ancestor node that satisfies the Condition. |
![]() | Normalize(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. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | ContentViewWalker | Represents a predefined TreeWalker containing a view of elements in the tree that are marked as content controls. |
![]() ![]() | ControlViewWalker | Represents a predefined TreeWalker containing a view of elements in the tree that are marked as controls. |
![]() ![]() | RawViewWalker | Represents a predefined TreeWalker containing a view of all the elements in the tree. |
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.
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.
