/// <summary> /// method used to execute a command /// </summary> /// <param name="command">command to execute</param> public static void ExecuteCommand(CommandInfo command) { if (command.CommandType == CommandUtils.CommandType.Mouse) { // if the command type is Mouse than move the mouse cursor MoveMouse(command.CommandString); } // no other command type available }
public static CommandInfo ParseArguments(string commandString) { CommandInfo commandInfo = null; string[] splitted = commandString.Split('|'); if (splitted.Length != 2) { commandInfo = null; } else { CommandUtils.CommandType commandType = (CommandUtils.CommandType)Enum.Parse(typeof(CommandUtils.CommandType), splitted[0]); string arguments = splitted[1]; commandInfo = new CommandInfo(commandType, arguments); } return commandInfo; }