public void Run() { ConsolePrinter successPrinter = new ConsolePrinter(ConsoleColor.Green); ConsolePrinter errorPrinter = new ConsolePrinter(ConsoleColor.Red); FileCopier copier = new FileCopier(); FileCopier.Printer printerSuccess = successPrinter.Print; FileCopier.Printer printerError = errorPrinter.Print; copier.StartCopying(printerSuccess, printerError); }
public void Run() { Logger logger = new Logger(); FileCopier.Printer printerConsole = logger.LogToConsole; FileCopier.Printer printerFile = logger.LogToFile; FileCopier.Printer printerCombined = printerConsole + printerFile; FileCopier copier = new FileCopier(); copier.StartCopying(printerCombined, null); }