TreeWalker TreeWalker TreeWalker TreeWalker Class

Definition

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

public ref class TreeWalker sealed
public sealed class TreeWalker
type TreeWalker = class
Public NotInheritable Class TreeWalker
Inheritance
TreeWalkerTreeWalkerTreeWalkerTreeWalker

Remarks

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.

Constructors

TreeWalker(Condition) TreeWalker(Condition) TreeWalker(Condition) TreeWalker(Condition)

Initializes a new instance of the TreeWalker class.

Fields

ContentViewWalker ContentViewWalker ContentViewWalker ContentViewWalker

Represents a predefined TreeWalker containing a view of elements in the tree that are marked as content controls.

ControlViewWalker ControlViewWalker ControlViewWalker ControlViewWalker

Represents a predefined TreeWalker containing a view of elements in the tree that are marked as controls.

RawViewWalker RawViewWalker RawViewWalker RawViewWalker

Represents a predefined TreeWalker containing a view of all the elements in the tree.

Properties

Condition Condition Condition Condition

Gets the object that defines the view for the TreeWalker object.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetFirstChild(AutomationElement) GetFirstChild(AutomationElement) GetFirstChild(AutomationElement) GetFirstChild(AutomationElement)

Retrieves the first child element of the specified AutomationElement.

GetFirstChild(AutomationElement, CacheRequest) GetFirstChild(AutomationElement, CacheRequest) GetFirstChild(AutomationElement, CacheRequest) GetFirstChild(AutomationElement, CacheRequest)

Retrieves the first child element of the specified AutomationElement and caches properties and patterns.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLastChild(AutomationElement) GetLastChild(AutomationElement) GetLastChild(AutomationElement) GetLastChild(AutomationElement)

Retrieves the last child element of the specified AutomationElement.

GetLastChild(AutomationElement, CacheRequest) GetLastChild(AutomationElement, CacheRequest) GetLastChild(AutomationElement, CacheRequest) GetLastChild(AutomationElement, CacheRequest)

Retrieves the last child element of the specified AutomationElement and caches properties and patterns.

GetNextSibling(AutomationElement) GetNextSibling(AutomationElement) GetNextSibling(AutomationElement) GetNextSibling(AutomationElement)

Retrieves the next sibling element of the specified AutomationElement.

GetNextSibling(AutomationElement, CacheRequest) GetNextSibling(AutomationElement, CacheRequest) GetNextSibling(AutomationElement, CacheRequest) GetNextSibling(AutomationElement, CacheRequest)

Retrieves the next sibling element of the specified AutomationElement and caches properties and patterns.

GetParent(AutomationElement) GetParent(AutomationElement) GetParent(AutomationElement) GetParent(AutomationElement)

Retrieves the parent element of the specified AutomationElement.

GetParent(AutomationElement, CacheRequest) GetParent(AutomationElement, CacheRequest) GetParent(AutomationElement, CacheRequest) GetParent(AutomationElement, CacheRequest)

Retrieves the parent element of the specified AutomationElement and caches properties and patterns.

GetPreviousSibling(AutomationElement) GetPreviousSibling(AutomationElement) GetPreviousSibling(AutomationElement) GetPreviousSibling(AutomationElement)

Retrieves the previous sibling of the specified AutomationElement.

GetPreviousSibling(AutomationElement, CacheRequest) GetPreviousSibling(AutomationElement, CacheRequest) GetPreviousSibling(AutomationElement, CacheRequest) GetPreviousSibling(AutomationElement, CacheRequest)

Retrieves the previous sibling of the specified AutomationElement and caches properties and patterns.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Normalize(AutomationElement) Normalize(AutomationElement) Normalize(AutomationElement) 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) Normalize(AutomationElement, CacheRequest) Normalize(AutomationElement, CacheRequest) 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() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also