Class
DesktopControl

Base class for desktop controls.

Definition

Constructors

DesktopControl()

Creates new DesktopControl

Declaration

cs-api-definition
public DesktopControl()

Fields

element

Underlying desktop element.

Declaration

cs-api-definition
protected DesktopElement element

Field Value

DesktopElement

Properties

Element

Underlying desktop element.

Declaration

cs-api-definition
public DesktopElement Element { get; }

Property Value

DesktopElement

Find

Find object. Use to search desktop elements by specific properties.

Declaration

cs-api-definition
public virtual DesktopFind Find { get; }

Property Value

DesktopFind

User

Gets the UI interaction object that allows you to interact with this DesktopControl directly using real mouse and keyboard interactions

Declaration

cs-api-definition
[Browsable(false)]
public virtual UserInteraction User { get; }

Property Value

UserInteraction

Methods

CreateOrNull<T>(Func<T>)

Invoke creator function. If it fails return null.

Declaration

cs-api-definition
protected T CreateOrNull<T>(Func<T> creator)

Parameters

creator

Func<T>

Creator function.

Returns

T

Instance of T.

Exists()

Verify underlying element still exists.

Declaration

cs-api-definition
public bool Exists()

Returns

bool

True if element exists, otherwise false.

InitControl(DesktopElement)

Initialize desktop control.

Declaration

cs-api-definition
protected virtual void InitControl(DesktopElement element)

Parameters

element

DesktopElement

Underlying element.

PointsToSameAs(DesktopControl)

Determine if two desktop control instances point to same UI component.

Declaration

cs-api-definition
public bool PointsToSameAs(DesktopControl control)

Parameters

control

DesktopControl

The control to compare against.

Returns

bool

True if both desktop controls point to same UI component, otherwise false.

ValidateControlType(int, string)

Validate underlying element control type.

Declaration

cs-api-definition
protected void ValidateControlType(int controlType, string controlName)

Parameters

controlType

int

Expected control type.

controlName

string

Control name. Used in generated error message.

ValidatePatternAvailable(int, string)

Validate whether pattern is available or not.

Declaration

cs-api-definition
protected void ValidatePatternAvailable(int patternAvailableProperty, string patternName)

Parameters

patternAvailableProperty

int

Id of property identifying patter is available.

patternName

string

Pattern name.

WaitFor(Func<bool>, int, int)

Wait for predicate to become true or timeout to occur.

Declaration

cs-api-definition
public bool WaitFor(Func<bool> predicate, int delay = 500, int timeout = 2500)

Parameters

predicate

Func<bool>

Predicate to wait for.

delay

int

Delay in milliseconds before invoking the predicate.

timeout

int

Operation timeout in milliseconds.

Returns

bool

True if predicate was true within timeout interval, otherwise false.

WaitForNoMotion(int, int)

Wait for control to be stationary.

Declaration

cs-api-definition
public bool WaitForNoMotion(int checkInterval = 500, int timeout = 2500)

Parameters

checkInterval

int

Check interval in ms.

timeout

int

Timeout in ms.

Returns

bool

True if control is stationary, otherwise false.