Class TreeItem
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents an item in a tree.
public class TreeItem : Adapter, IAdapter
- Inheritance
-
TreeItem
- Implements
- Inherited Members
Constructors
TreeItem()
Creates a new TreeItem adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected TreeItem()
TreeItem(Element)
Creates a new TreeItem adapter instance.
public TreeItem(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
Checked
True if the tree item is checked.
public virtual bool Checked { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
DescendantItems
Gets all tree items contained in this subtree as a list.
public IList<TreeItem> DescendantItems { get; }
Property Value
Expanded
True if the tree item is expanded.
public virtual bool Expanded { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Image
The image or icon associated with the tree item.
public virtual Image Image { 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 this tree item.
public IList<TreeItem> Items { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
Selected
True if the tree item is selected.
public virtual bool Selected { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
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 this tree item.
public IList<TreeItem> SelectedItems { get; }
Property Value
Text
The text of the tree item.
public virtual string Text { get; }
Property Value
Methods
Collapse()
Collapses the tree item, hiding its children.
public void Collapse()
CollapseAll()
Collapses the tree item and all its children, recursively.
public void CollapseAll()
Expand()
Expands the tree item, making its children visible.
public void Expand()
ExpandAll()
Expands the tree item and all its children, recursively.
public void ExpandAll()
FromElement(Element)
Converts an Element to an instance of this class.
public static TreeItem FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- TreeItem
The TreeItem.
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 TreeItem FromPath(string path)
Parameters
pathstringThe search path.
Returns
- TreeItem
The TreeItem.
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.
Select()
Selects the item.
public virtual void Select()
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
Operators
implicit operator TreeItem(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator TreeItem(Element element)
Parameters
elementElementThe element to convert.
Returns
- TreeItem
The TreeItem.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator TreeItem(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator TreeItem(string path)
Parameters
pathstringThe search path.
Returns
- TreeItem
The TreeItem.
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.