Class List
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents a logical list such as a listbox.
public class List : Adapter, IAdapter
- Inheritance
-
List
- Implements
- Inherited Members
Constructors
List()
Creates a new List adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected List()
List(Element)
Creates a new List adapter instance.
public List(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
this[string]
Gets the ListItem with the specified item label.
public ListItem this[string itemLabel] { get; }
Parameters
itemLabelstring
Property Value
- ListItem
The list item.
Exceptions
- ElementNotFoundException
If no item with that label is found.
Items
Gets the list items contained in the list.
public IList<ListItem> Items { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
SelectedItemIndex
The index of the currently selected item.
public virtual int SelectedItemIndex { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
SelectedItemText
The text of the currently selected item.
public virtual string SelectedItemText { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
SelectedItems
Gets the list of selected items contained in the list.
public IList<ListItem> SelectedItems { get; }
Property Value
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static List FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- List
The List.
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 List FromPath(string path)
Parameters
pathstringThe search path.
Returns
- List
The List.
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 List(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator List(Element element)
Parameters
elementElementThe element to convert.
Returns
- List
The List.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator List(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator List(string path)
Parameters
pathstringThe search path.
Returns
- List
The List.
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.