private void Edit(object sender, RoutedEventArgs e)
        {
            int x, y, rx, ry;
            int RandStatus = GetRandStatus();

            try
            {
                x = Convert.ToInt32(txt_x_pos.Text);
                y = Convert.ToInt32(txt_y_pos.Text);
                if (RandStatus == 1)
                {
                    rx = Convert.ToInt32(txtBox_MoveFactor.Text);
                    ry = 0;
                }
                else if (RandStatus == 2)
                {
                    rx = Convert.ToInt32(txtBox_MoveFactor.Text.Split(':')[0]);
                    ry = Convert.ToInt32(txtBox_MoveFactor.Text.Split(':')[1]);
                }
                else
                {
                    rx = 0;
                    ry = 0;
                }
            }
            catch
            {
                x  = 0;
                y  = 0;
                rx = 0;
                ry = 0;
            }

            Point MouseFactor = new Point(rx, ry);
            Point MousePoint  = new Point(x, y);

            string MouseAction = "Move/" + MousePoint.ToString();

            if (RandStatus == 1)
            {
                MouseAction += "/C/" + MouseFactor.X.ToString();
            }
            else if (RandStatus == 2)
            {
                MouseAction += "/R/" + MouseFactor.ToString();
            }

            macro = new MouseMacro()
            {
                Control    = "Mouse",
                Action     = MouseAction,
                Status     = 1,//MouseMove
                Coordinate = MousePoint,
                RandStatus = RandStatus,
                Parameter  = MouseFactor
            };
            DialogResult = true;
            Close();
        }
示例#2
0
 private void Edit(object sender, RoutedEventArgs e)
 {
     macro = new MouseMacro()
     {
         Control     = "Mouse",
         Action      = GetMouseBtnText(),
         Status      = 0, // MouseClick
         MouseButton = GetMouseBtn()
     };
     DialogResult = true;
     Close();
 }
示例#3
0
 public MouseMacroInput(MouseMacro macro)
 {
     Macro = macro;
 }