protected void DoubleClickImplementation(PointerButtons button, double offsetX, double offsetY) { if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: "DoubleClick", button, (object)offsetX, (object)offsetY)) != ActionResult.Unhandled) { return; } MovePointer(offsetX: offsetX, offsetY: offsetY); PointerInput.Click(button: button, count: 2); }
public override string ToString() { object overridden; if (ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: nameof(ToString)), overridden: out overridden) == ActionResult.Handled) { return((string)overridden); } return("{" + Name + ", " + ClassName + ", " + RuntimeId + "}"); }
public void SetFocus() { var num = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); if (ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: nameof(SetFocus))) != ActionResult.Unhandled || (bool)AutomationElement.GetCurrentPropertyValue(property: AutomationElement.HasKeyboardFocusProperty)) { return; } AutomationElement.SetFocus(); }
public void SendKeys(string text) { Validate.StringNeitherNullNorEmpty(parameter: text, parameterName: nameof(text)); SetFocus(); if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(SendKeys), text)) != ActionResult.Unhandled) { return; } TextInput.SendText(text: text); }
public void SaveImage(string fileName) { Validate.StringNeitherNullNorEmpty(parameter: fileName, parameterName: nameof(fileName)); var num = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(SaveImage), fileName)) != ActionResult.Unhandled) { return; } ScreenCapture.SaveImage(rectangle: BoundingRectangle, fileName: fileName); }
public virtual void TapAndHold(double offsetX, double offsetY, uint duration) { var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible")); if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(TapAndHold), offsetX, (object)offsetY, (object)duration)) != ActionResult.Unhandled) { return; } SinglePointGesture.Current.Move(point: ObjectPointToScreenPoint(objectPoint: new PointI(x: (int)Math.Round(a: offsetX), y: (int)Math.Round(a: offsetY)))); SinglePointGesture.PressAndHold(holdDuration: duration); }
public void ClickDrag(PointerButtons button, UIObject uiObject) { Validate.ArgumentNotNull(parameter: uiObject, parameterName: nameof(uiObject)); var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible")); if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(ClickDrag), button, (object)uiObject)) != ActionResult.Unhandled) { return; } PointerInput.ClickDrag(targetObject: this, destinationObject: uiObject, button: button); }
public virtual void DoubleTap(double offsetX, double offsetY) { var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible")); if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(DoubleTap), offsetX, (object)offsetY)) != ActionResult.Unhandled) { return; } using (InputController.Activate(inputType: PointerInputType.MultiTouch)) { PointerInput.DoubleClick(uiObject: this, button: PointerButtons.Primary, offsetX: offsetX, offsetY: offsetY); } }
public virtual void Flick(PointI startPoint, PointI endPoint) { var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible")); if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(Flick), startPoint, (object)endPoint)) == ActionResult.Unhandled) { var screenPoint1 = ObjectPointToScreenPoint(objectPoint: startPoint); var screenPoint2 = ObjectPointToScreenPoint(objectPoint: endPoint); SinglePointGesture.Current.Move(point: screenPoint1); var defaultPressDuration = (int)InputManager.DefaultPressDuration; double flickAcceleration = SinglePointGesture.DefaultFlickAcceleration; SinglePointGesture.Flick(endPoint: screenPoint2, holdDuration: (uint)defaultPressDuration, acceleration: (float)flickAcceleration); } var num3 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "UIScrollComplete")); }
public PointI GetClickablePoint() { var num = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady")); object overridden; if (ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: nameof(GetClickablePoint)), overridden: out overridden) == ActionResult.Handled) { return((PointI)overridden); } Point pt; if (AutomationElement.TryGetClickablePoint(pt: out pt)) { return(new PointI(x: (int)pt.X, y: (int)pt.Y)); } var boundingRectangle = BoundingRectangle; return(new PointI(x: boundingRectangle.X + boundingRectangle.Width / 2, y: boundingRectangle.Y + boundingRectangle.Height / 2)); }
public static UIObject FromPoint(PointI pixelLocation) { object overridden; return(ActionHandler.Invoke(sender: null, actionInfo: new ActionEventArgs(action: nameof(FromPoint), (object)pixelLocation), overridden: out overridden) == ActionResult.Handled ? (UIObject)overridden : new UIObject(element: AutomationElement.FromPoint(pt: new Point(x: pixelLocation.X, y: pixelLocation.Y)))); }
public static UIObject FromHandle(IntPtr hwnd) { object overridden; return(ActionHandler.Invoke(sender: null, actionInfo: new ActionEventArgs(action: nameof(FromHandle), (object)hwnd), overridden: out overridden) == ActionResult.Handled ? (UIObject)overridden : new UIObject(element: AutomationElement.FromHandle(hwnd: hwnd))); }