Table of Contents

Class ToggleButton

Namespace
Ranorex
Assembly
Ranorex.Plugin.Mobile.dll

Capability for ToggleButton UI elements.

public class ToggleButton : Adapter, IAdapter
Inheritance
ToggleButton
Implements
Inherited Members

Constructors

ToggleButton()

Creates a new ToggleButton adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!

protected ToggleButton()

ToggleButton(Element)

Creates a new ToggleButton adapter instance.

public ToggleButton(Element element)

Parameters

element Element

The element to create the adapter for.

Exceptions

NullReferenceException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Properties

RequiredCapabilities

Capabilities required by the adapter implementation.

protected override string[] RequiredCapabilities { get; }

Property Value

string[]

State

If true then the toggle button is in the 'On' state. Otherwise it is in the 'Off' state.

[OriginalDisplayName("ToggleButtonState")]
public virtual bool State { get; set; }

Property Value

bool

Exceptions

SetAttributeFailedException

Thrown if setting the attribute value failed.

Methods

FromElement(Element)

Converts an Element to an instance of this class.

public static ToggleButton FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

ToggleButton

The ToggleButton.

Exceptions

ArgumentNullException

If element is null.

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 ToggleButton FromPath(string path)

Parameters

path string

The search path.

Returns

ToggleButton

The ToggleButton.

Remarks

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Operators

implicit operator ToggleButton(Element)

Implicitly converts an Element to an instance of this class.

public static implicit operator ToggleButton(Element element)

Parameters

element Element

The element to convert.

Returns

ToggleButton

The ToggleButton.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

implicit operator ToggleButton(string)

Implicitly converts a string to an instance of this class by searching the root.

public static implicit operator ToggleButton(string path)

Parameters

path string

The search path.

Returns

ToggleButton

The ToggleButton.

Remarks

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.