Class RawText
- Namespace
- Ranorex
- Assembly
- Ranorex.Plugin.RawText.dll
Raw text drawn by the GDI API.
public class RawText : Adapter, IAdapter
- Inheritance
-
RawText
- Implements
- Inherited Members
Constructors
RawText()
Creates a new RawText adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected RawText()
RawText(Element)
Creates a new RawText adapter instance.
public RawText(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
Column
The inferred text column.
public virtual int Column { get; }
Property Value
FontName
The font name.
public virtual string FontName { get; }
Property Value
FontSize
The font size in logical units.
public virtual int FontSize { get; }
Property Value
FontStyle
The font style.
public virtual string FontStyle { get; }
Property Value
Origin
The origin of the captured text.
public virtual string Origin { get; }
Property Value
RawTextValue
The captured raw text.
[OriginalDisplayName("RawText")]
public virtual string RawTextValue { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
Row
The inferred text row.
public virtual int Row { get; }
Property Value
TextColor
The text foreground color.
public virtual string TextColor { get; }
Property Value
Methods
CaptureString(Element)
Tries to capture the raw text string content from the specified element.
public static string CaptureString(Element element)
Parameters
elementElementThe element to capture the text from. The element must have the nativewindow capability.
Returns
- string
The captured text string or
nullif theelementdoes not support the nativewindow capability.
Exceptions
- ArgumentNullException
If
elementis anullreference.- RanorexException
If capturing the raw text fails, e.g. due to security restrictions.
FromElement(Element)
Converts an Element to an instance of this class.
public static RawText FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- RawText
The RawText.
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 RawText FromPath(string path)
Parameters
pathstringThe search path.
Returns
- RawText
The RawText.
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 RawText(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator RawText(Element element)
Parameters
elementElementThe element to convert.
Returns
- RawText
The RawText.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator RawText(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator RawText(string path)
Parameters
pathstringThe search path.
Returns
- RawText
The RawText.
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.