private static void HandleRequest(string[] split) { var request = split.First(); var parameters = split.Skip(1).ToArray(); if (Environment.IsSystemCommand(request)) { var command = Environment.GetSystemCommand(request); command.Execute(parameters); } else if (Environment.IsView(request)) { var view = Environment.GetView(request); view.Print(parameters); } else { ICommandBuilder commandBuilder = Environment.GetShellCommand(request); ICommand command = commandBuilder.Build(parameters); Recorder.AddCommand(command); IPublishCommands commandPublisher = Environment.GetCommandPublisher(); commandPublisher.Publish(command); } }
private static void HandleRequest(string[] split) { if (Environment.IsSystemCommand(split.First())) { var command = Environment.GetSystemCommand(split.First()); command.Execute(split.Skip(1).ToArray()); } else { ICommandBuilder commandBuilder = Environment.GetShellCommand(split.First()); ICommand command = commandBuilder.Build(split.Skip(1).ToArray()); Recorder.AddCommand(command); IPublishCommands commandPublisher = Environment.GetCommandPublisher(); commandPublisher.Publish(command); } }