private void uiNextButton_Click(object sender, EventArgs e) { bool isValid = AreValidEntries(); if (!isValid) { return; } Dictionary <string, string> caseDetails = GetCaseDetails(); WaitWindow.Show(CreateCase, Resources.strings.creating_case_wait, caseDetails); NextClick?.Invoke(this, e); }
private void btnNext_Click(object sender, EventArgs e) { this.btnNext.Invoke(new Action(() => { this.lbTip.Text = string.Empty; if (PageabledEventArgs.PageIndex >= PageabledEventArgs.PageCount) { PageabledEventArgs.PageIndex = PageabledEventArgs.PageCount; this.lbTip.Text = "最后1页"; } else { this.lbTip.Text = string.Empty; PageabledEventArgs.PageIndex++; NextClick?.Invoke(sender, PageabledEventArgs); } })); }
private void Run() { SyncSettings(); int remaining = count; while (countType == CountType.UntilStopped || remaining > 0) { if (!IsAlive) { return; } foreach (AutoAction action in Actions) { SyncSettings(); //Delay int nextDelay = action.delayType == DelayType.Fixed ? action.delay : nextDelay = rnd.Next(action.delay, action.delayRange); if (action.AutoActionType == ActionType.Click) { Clicker.Click(action); } else if (action.AutoActionType == ActionType.Type) { } NextClick?.Invoke(this, new NextClickEventArgs { NextClick = nextDelay }); Thread.Sleep(nextDelay);//Sleep delay time } remaining--; } Finished?.Invoke(this, null); }
private void NextButton_Click(object sender, RoutedEventArgs e) { NextClick?.Invoke(this, e); }
private void btNext_Click(object sender, EventArgs e) { OnNextButtonClick(e); if (NextClick != null) NextClick.Invoke(this, e); }
private void Click() { System.Diagnostics.Debug.Print("Click() started"); SyncSettings(); int remaining = count; //System.Diagnostics.Debug.Print("Count type: {0}, count: {1}", countType, count); while (countType == CountType.UntilStopped || remaining > 0) { if (!IsAlive) { return; } SyncSettings(); List <Win32.INPUT> inputs = new List <Win32.INPUT>(); // Move the mouse if required. if (locationType == LocationType.Fixed) { Win32.INPUT input = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dx = Win32.CalculateAbsoluteCoordinateX(x), dy = Win32.CalculateAbsoluteCoordinateX(y), dwFlags = Win32.MouseEventFlags.Move | Win32.MouseEventFlags.Absolute } }; inputs.Add(input); } else if (locationType == LocationType.Random) { Win32.INPUT input = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dx = rnd.Next(65536), dy = rnd.Next(65536), dwFlags = Win32.MouseEventFlags.Move | Win32.MouseEventFlags.Absolute } }; inputs.Add(input); } else if (locationType == LocationType.RandomRange) { Win32.INPUT input = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dx = Win32.CalculateAbsoluteCoordinateX(rnd.Next(x, x + width)), dy = Win32.CalculateAbsoluteCoordinateY(rnd.Next(y, y + height)), dwFlags = Win32.MouseEventFlags.Move | Win32.MouseEventFlags.Absolute } }; inputs.Add(input); } //System.Diagnostics.Debug.Print("Move command added"); // マウスをクリック for (int i = 0; i < (doubleClick ? 2 : 1); i++) { // Add a delay if it's a double click. if (i == 1) { Thread.Sleep(50); } if (buttonType == ButtonType.Left) { Win32.INPUT inputDown = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dwFlags = Win32.MouseEventFlags.LeftDown } }; inputs.Add(inputDown); Win32.INPUT inputUp = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dwFlags = Win32.MouseEventFlags.LeftUp } }; inputs.Add(inputUp); } if (buttonType == ButtonType.Middle) { Win32.INPUT inputDown = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dwFlags = Win32.MouseEventFlags.MiddleDown } }; inputs.Add(inputDown); Win32.INPUT inputUp = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dwFlags = Win32.MouseEventFlags.MiddleUp } }; inputs.Add(inputUp); } if (buttonType == ButtonType.Right) { Win32.INPUT inputDown = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dwFlags = Win32.MouseEventFlags.RightDown } }; inputs.Add(inputDown); Win32.INPUT inputUp = new Win32.INPUT { type = Win32.SendInputEventType.InputMouse, mi = new Win32.MOUSEINPUT { dwFlags = Win32.MouseEventFlags.RightUp } }; inputs.Add(inputUp); } } //System.Diagnostics.Debug.Print("Click commands added"); //INPUT[] input = new INPUT[2]; //input[0].mi.dwFlags = Win32.MOUSEEVENTF_LEFTDOWN; //input[1].mi.dwFlags = Win32.MOUSEEVENTF_LEFTUP; //Win32.SendInput(2, input, Marshal.SizeOf(input[0])); Win32.SendInput((uint)inputs.Count, inputs.ToArray(), Marshal.SizeOf(new Win32.INPUT())); //System.Diagnostics.Debug.Print("Command sent"); // ちょっと寝る int nextDelay = 0; if (delayType == DelayType.Fixed) { nextDelay = delay; } else { nextDelay = rnd.Next(delay, delayRange); } NextClick?.Invoke(this, new NextClickEventArgs { NextClick = nextDelay }); Thread.Sleep(nextDelay); //System.Diagnostics.Debug.Print("Had a nap"); remaining--; } Finished?.Invoke(this, null); }