예제 #1
0
        public void AddMouseDown(MouseEventArgs evt)
        {
            IUserCommand lastCommand = GetLastCommand();
            var          mouseDown   = new MouseDownCommand(evt);

            Commands.Add(mouseDown);
            Dbg <MouseDownCommand>("Added", evt);
        }
예제 #2
0
        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);
        }
예제 #3
0
 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);
 }
예제 #4
0
        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);
        }
예제 #5
0
 private void Canvas_PreviewMouseDown(object sender, MouseButtonEventArgs e)
 {
     MouseDownCommand?.Execute(e.GetPosition(this));
 }
예제 #6
0
 private void OnMouseDown(object sender, MouseButtonEventArgs e)
 {
     e.Handled       = true;
     MouseButtonArgs = e;
     MouseDownCommand.Execute(null);
 }