public static void Main() { StringBuilder output = new StringBuilder(); Catalog catalog = new Catalog(); ICommandExecutor commandExecutor = new CommandExecutor(); var CommandsList = CommandParser(); foreach (ICommand command in CommandsList) { commandExecutor.ExecuteCommand(catalog, command, output); } Console.Write(output); //printing the output }
public static void Main() { StringBuilder output = new StringBuilder(); Catalog catalog = new Catalog(); ICommandExecutor commandExecutor = new CommandExecutor(); List<ICommand> inputCommands = ReadInput(); foreach (ICommand command in inputCommands) { commandExecutor.ExecuteCommand(catalog, command, output); } // Console.BackgroundColor = ConsoleColor.DarkGreen; Console.Write(output); // printing the output }