Table of Contents

Class UIAutomationToggle

Namespace
Ranorex
Assembly
Ranorex.Plugin.Uia.dll

Capability for the UIA Toggle pattern.

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

Constructors

UIAutomationToggle()

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

protected UIAutomationToggle()

UIAutomationToggle(Element)

Creates a new UIAutomationToggle adapter instance.

public UIAutomationToggle(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[]

ToggleState

The value of the element.

[OriginalDisplayName("UIAutomationToggleToggleState")]
public virtual ToggleState ToggleState { get; }

Property Value

ToggleState

Methods

FromElement(Element)

Converts an Element to an instance of this class.

public static UIAutomationToggle FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

UIAutomationToggle

The UIAutomationToggle.

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

Parameters

path string

The search path.

Returns

UIAutomationToggle

The UIAutomationToggle.

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.

Toggle()

Cycles through the toggle states of the element.

[OriginalDisplayName("UIAutomationToggleToggle")]
public virtual void Toggle()

Exceptions

ActionFailedException

Thrown if invoking the action failed.

Operators

implicit operator UIAutomationToggle(Element)

Implicitly converts an Element to an instance of this class.

public static implicit operator UIAutomationToggle(Element element)

Parameters

element Element

The element to convert.

Returns

UIAutomationToggle

The UIAutomationToggle.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

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

implicit operator UIAutomationToggle(string)

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

public static implicit operator UIAutomationToggle(string path)

Parameters

path string

The search path.

Returns

UIAutomationToggle

The UIAutomationToggle.

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.