Class Text
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents an edit box, a text area, or static text.
public class Text : Adapter, IAdapter
- Inheritance
-
Text
- Implements
- Inherited Members
Constructors
Text()
Creates a new Text adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected Text()
Text(Element)
Creates a new Text adapter instance.
public Text(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
BackgroundColor
The text backgroundcolor.
[OriginalDisplayName("BackgroundColor")]
public virtual string BackgroundColor { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Caption
The caption, if the text is not editable.
public virtual string Caption { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
SelectionLength
The length of the selected text.
public virtual int SelectionLength { get; }
Property Value
SelectionStart
The start index of the selected text.
public virtual int SelectionStart { get; }
Property Value
SelectionText
The selected text portion.
public virtual string SelectionText { get; }
Property Value
TextColor
The text color.
[OriginalDisplayName("TextColor")]
public virtual string TextColor { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
TextValue
The text content.
[OriginalDisplayName("Text")]
public virtual string TextValue { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static Text FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- Text
The Text.
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 Text FromPath(string path)
Parameters
pathstringThe search path.
Returns
- Text
The Text.
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(int, int)
Selects the specified text range.
public virtual void Select(int start, int length)
Parameters
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
Operators
implicit operator Text(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator Text(Element element)
Parameters
elementElementThe element to convert.
Returns
- Text
The Text.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator Text(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator Text(string path)
Parameters
pathstringThe search path.
Returns
- Text
The Text.
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.