Class ListItem
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents an item in a list.
public class ListItem : Adapter, IAdapter
- Inheritance
-
ListItem
- Implements
- Inherited Members
Constructors
ListItem()
Creates a new ListItem adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected ListItem()
ListItem(Element)
Creates a new ListItem adapter instance.
public ListItem(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
Image
The image contained in the item.
public virtual Image Image { get; }
Property Value
Index
The index of the item in the container list.
public virtual int Index { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
Selected
True if the item is currently selected.
public virtual bool Selected { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Text
The text of the item.
public virtual string Text { get; }
Property Value
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static ListItem FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- ListItem
The ListItem.
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 ListItem FromPath(string path)
Parameters
pathstringThe search path.
Returns
- ListItem
The ListItem.
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 ListItem(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator ListItem(Element element)
Parameters
elementElementThe element to convert.
Returns
- ListItem
The ListItem.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator ListItem(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator ListItem(string path)
Parameters
pathstringThe search path.
Returns
- ListItem
The ListItem.
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.