private void CreateVerbosityCommand(string arguments) { if (string.IsNullOrEmpty(arguments)) { CreateInvalidCommand(); return; } string[] argumentsArray; argumentsArray = arguments.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); if (argumentsArray.Length > 2 || argumentsArray.Length < 1) { CreateInvalidCommand(); return; } int level; bool noreply = false; try { level = int.Parse(argumentsArray[0]); noreply = (argumentsArray.Length > 1 && argumentsArray[1] == "noreply") ? true : false; } catch (Exception) { CreateInvalidCommand(); return; } _command = new VerbosityCommand(); _command.NoReply = noreply; this.State = ParserState.ReadyToDispatch; }
public void CreateVerbosityCommand() { int level = ((_rawData[0] << 24) | (_rawData[1] << 16) | (_rawData[2] << 8) | _rawData[3]); _command = new VerbosityCommand(level); }