Exemplo n.º 1
0
        public static ExecutedCommand Error(string message)
        {
            ExecutedCommand exec = new ExecutedCommand();

            exec.Success      = false;
            exec.ErrorMessage = message;

            return(exec);
        }
Exemplo n.º 2
0
        public ExecutedCommand Execute()
        {
            ExecutedCommand cmd = new ExecutedCommand();

            cmd.Uuid = this.Uuid;

            WindowsInput.InputSimulator simulator = new WindowsInput.InputSimulator();

            cmd.Success = true;

            switch (Command)
            {
            case "mouse_info":
                cmd.Result = new MouseInfoCommand().Execute();
                break;

            case "mouse_click":
                MouseClickCommand _cmdClick = new MouseClickCommand(simulator);
                _cmdClick.SetData(ConvertObject <MouseClickInput>(Data));
                cmd.Result = _cmdClick.Execute();
                break;

            case "mouse_move":
                MouseMoveCommand _cmdMove = new MouseMoveCommand(simulator);
                _cmdMove.SetData(ConvertObject <MouseMoveInput>(Data));
                cmd.Result = _cmdMove.Execute();
                break;

            case "keyboard_input":
                KeyboardInputCommand _keyboardCommand = new KeyboardInputCommand(simulator);
                _keyboardCommand.SetData(ConvertObject <KeyboardInputInput>(Data));
                cmd.Result = _keyboardCommand.Execute();
                break;

            case "process_list":
                ProcessCommand _processCommand = new ProcessCommand();
                _processCommand.SetData(ConvertObject <ProcessInput>(Data));
                cmd.Result = _processCommand.Execute();
                break;

            default:
                cmd.ErrorMessage = "Command not found";
                cmd.Success      = false;

                break;
            }

            return(cmd);
        }