/// <summary> /// Powershell logic. /// </summary> protected override void ProcessRecord() { var ss = new ScreenScraper(); var pos = ss.Find(ss.CaptureScreen(), Image); if (pos.Right == -1 && pos.Left == -1) { throw new ApplicationException("Can't find image on screen!"); } ss.MoveMouse(pos.X + XOffset, pos.Y + YOffset); if (Click) { ss.MouseClick(Button == "Left" ? MouseButton.Left : MouseButton.Right); } else if (Up) { ss.MouseUp(Button == "Left" ? MouseButton.Left : MouseButton.Right); } else if (Down) { ss.MouseDown(Button == "Left" ? MouseButton.Left : MouseButton.Right); } }
/// <summary> /// Powershell logic. /// </summary> protected override void ProcessRecord() { var ss = new ScreenScraper(); if (Click) { ss.MouseClick(Button == "Left" ? MouseButton.Left : MouseButton.Right); } else if (Up) { ss.MouseUp(Button == "Left" ? MouseButton.Left : MouseButton.Right); } else if (Down) { ss.MouseDown(Button == "Left" ? MouseButton.Left : MouseButton.Right); } }