Class Tree
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents a tree control.
public class Tree : Adapter, IAdapter
- Inheritance
-
Tree
- Implements
- Inherited Members
Constructors
Tree()
Creates a new Tree adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected Tree()
Tree(Element)
Creates a new Tree adapter instance.
public Tree(Element element)
Parameters
elementElementThe element to create the adapter for.
Exceptions
- NullReferenceException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Properties
DescendantItems
Gets all tree items contained in this subtree as a list.
public IList<TreeItem> DescendantItems { get; }
Property Value
this[string]
Gets the TreeItem with the specified item label.
public TreeItem this[string itemLabel] { get; }
Parameters
itemLabelstring
Property Value
- TreeItem
The list item.
Exceptions
- ElementNotFoundException
If no item with that label is found.
Items
Gets the tree items which are immediate children of the tree.
public IList<TreeItem> Items { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
SelectedDescendantItems
Gets all selected tree items contained in this subtree as a list.
public IList<TreeItem> SelectedDescendantItems { get; }
Property Value
SelectedItems
Gets the selected tree items which are immediate children of the tree.
public IList<TreeItem> SelectedItems { get; }
Property Value
Methods
CollapseAll()
Collapses all nodes in the tree.
public void CollapseAll()
ExpandAll()
Expands all nodes in the tree.
public void ExpandAll()
FromElement(Element)
Converts an Element to an instance of this class.
public static Tree FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- Tree
The Tree.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
FromPath(string)
Converts a string to an instance of this class by searching the root.
public static Tree FromPath(string path)
Parameters
pathstringThe search path.
Returns
- Tree
The Tree.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Operators
implicit operator Tree(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator Tree(Element element)
Parameters
elementElementThe element to convert.
Returns
- Tree
The Tree.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator Tree(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator Tree(string path)
Parameters
pathstringThe search path.
Returns
- Tree
The Tree.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.