public void AddMouseDown(MouseEventArgs evt) { IUserCommand lastCommand = GetLastCommand(); var mouseDown = new MouseDownCommand(evt); Commands.Add(mouseDown); Dbg <MouseDownCommand>("Added", evt); }
private void MouseHook_MouseDown(object sender, MouseEventArgs e) { if (!isRecording || settings.clickInsteadOfUpDown) { return; } Command newCommand = new MouseDownCommand(DateTime.Now.TimeOfDay - elapsedTime, e.Location.X, e.Location.Y, e.Button); elapsedTime = DateTime.Now.TimeOfDay; onNewCommand?.Invoke(newCommand); }
public ReciepeBookVM() { GetCuisines(); GetReciepes(); GetReciepeTypes(); MouseDownCommand = new MouseDownCommand(this); ShowByCategoryCommand = new ShowByCategoryCommand(this); ListViewItemMouseDoubleClick = new ListViewItemMouseDoubleClick(this); ShowAllCommand = new ShowAllCommand(this); OpenAddReciepeCommand = new OpenAddReciepeCommand(this); DeleteCommand = new DeleteCommand(this); OpenChangeWindowCommand = new OpenChangeWindowCommand(this); }
private bool AreCoordinatesClose(MouseUpCommand mouseUp, MouseDownCommand mouseDown, int pixelTollerance) { if (mouseUp == null) { return(false); } if (mouseDown == null) { return(false); } bool isCloseX = Math.Abs(mouseUp.MouseEvent.X - mouseDown.MouseEvent.X) <= pixelTollerance; bool isCloseY = Math.Abs(mouseUp.MouseEvent.Y - mouseDown.MouseEvent.Y) <= pixelTollerance; return(isCloseX && isCloseY); }
private void Canvas_PreviewMouseDown(object sender, MouseButtonEventArgs e) { MouseDownCommand?.Execute(e.GetPosition(this)); }
private void OnMouseDown(object sender, MouseButtonEventArgs e) { e.Handled = true; MouseButtonArgs = e; MouseDownCommand.Execute(null); }