Table of Contents

Class UIActionSimulator

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

UIActionSimulator is a class used to simulate user interface actions such as a mouse click or a key press. Common usage for this class would be to provide playback and record (aka macro recording) functionality for users, or to drive unit tests by simulating user sessions. This class currently doesn't work when using Wayland with Linux.

public class UIActionSimulator : HandledObject<IActionSimulatorHandler>, IBaseObject, IDisposableObject, IDisposable, INotifyPropertyChanged
Inheritance
UIActionSimulator
Implements

Remarks

Only left, right or middle mouse buttons are supported in this class.

Constructors

UIActionSimulator()

Initializes a new instance of the UIActionSimulator class.

UIActionSimulator(IActionSimulatorHandler)

Initializes a new instance of the UIActionSimulator class.

Methods

CreateHandler()

Creates handler.

SendChar(Key, ModifierKeys)

Presses and release a key.

SendCharIf(ref bool, Key, ModifierKeys)

Same as SendChar(Key, ModifierKeys) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendKey(Key, ModifierKeys)

Sends key. This methods calls SendKeyDown(Key, ModifierKeys) and SendKeyUp(Key, ModifierKeys).

SendKeyDown(Key, ModifierKeys)

Presses a key.

SendKeyDownIf(ref bool, Key, ModifierKeys)

Same as SendKeyDown(Key, ModifierKeys) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendKeyIf(ref bool, Key, ModifierKeys)

Same as SendKey(Key, ModifierKeys) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendKeyUp(Key, ModifierKeys)

Releases a key.

SendKeyUpIf(ref bool, Key, ModifierKeys)

Same as SendKeyUp(Key, ModifierKeys) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendMouseClick(MouseButton)

Clicks a mouse button.

SendMouseClickIf(ref bool, MouseButton)

Same as SendMouseClick(MouseButton) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendMouseDblClick(MouseButton)

Double-clicks a mouse button.

SendMouseDblClickIf(ref bool, MouseButton)

Same as SendMouseDblClick(MouseButton) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendMouseDown(MouseButton)

Presses a mouse button.

SendMouseDownIf(ref bool, MouseButton)

Same as SendMouseDown(MouseButton) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendMouseDragDrop(int, int, int, int, MouseButton)

Performs a drag and drop operation.

SendMouseDragDropIf(ref bool, int, int, int, int, MouseButton)

Same as SendMouseDragDrop(int, int, int, int, MouseButton) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendMouseMove(PointI)

Moves the mouse to the specified coordinates.

SendMouseMove(Control, PointD?)

Moves the mouse to the top-left corner of the control.

SendMouseMoveIf(ref bool, PointI)

Same as SendMouseMove(PointI) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendMouseMoveIf(ref bool, Control, PointD?)

Same as SendMouseMove(Control, PointD?) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendMouseUp(MouseButton)

Releases a mouse button.

SendMouseUpIf(ref bool, MouseButton)

Same as SendMouseUp(MouseButton) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendSelect(string)

Simulates selection of an item with the given text.

SendSelectIf(ref bool, string)

Same as SendSelect(string) but checks for the condition before sending action. This method sets condition to the result of the send action operation.

SendText(string)

Emulates typing in the keys representing the given string.

SendTextIf(ref bool, string)

Same as SendText(string) but checks for the condition before sending action. This method sets condition to the result of the send action operation.