private static void ThrowExceptionIfBrowserHostNull(IBrowserHost browserHost) { if (browserHost == null) { throw new Exception("IBrowserHost instance is null. Browser has likely not finished initializing or is in the process of disposing."); } }
public static void SendMouseWheelEvent(this IBrowserHost host, int x, int y, int deltaX, int deltaY, CefEventFlags modifiers) { ThrowExceptionIfBrowserHostNull(host); host.SendMouseWheelEvent(new MouseEvent(x, y, modifiers), deltaX, deltaY); }
public static void SendMouseClickEvent(this IBrowserHost host, int x, int y, MouseButtonType mouseButtonType, bool mouseUp, int clickCount, CefEventFlags modifiers) { ThrowExceptionIfBrowserHostNull(host); host.SendMouseClickEvent(new MouseEvent(x, y, modifiers), mouseButtonType, mouseUp, clickCount); }
public static void SendMouseMoveEvent(this IBrowserHost host, int x, int y, bool mouseLeave, CefEventFlags modifiers) { ThrowExceptionIfBrowserHostNull(host); host.SendMouseMoveEvent(new MouseEvent(x, y, modifiers), mouseLeave); }
public static void ExecuteClick(this IBrowserHost Browser, Point Position) { Browser.SendMouseClickEvent(new MouseEvent(Position.X, Position.Y, CefEventFlags.LeftMouseButton), MouseButtonType.Left, false, 1); ThreadTools.Wait(random.Next(49, 101)); Browser.SendMouseClickEvent(new MouseEvent(Position.X, Position.Y, CefEventFlags.LeftMouseButton), MouseButtonType.Left, true, 1); }