private static void Main(string[] args) { var report = new Report("", "It's very impressive report"); var formatter = new ReportFormatter(report); ReportPrinter.Print(formatter.Format("first caption")); ReportPrinter.Print(formatter.Format("second caption")); Console.ReadKey(); }
public static void Print(Report report) { Console.WriteLine("---------------------------"); Console.WriteLine(report.Header); Console.WriteLine("---------------------------"); Console.WriteLine(report.Body); Console.WriteLine("---------------------------"); }
public static Report FormatHeader(Report report, string header) { return new Report("Caption: " + header + " " + DateTime.Now, report.Body); }