コード例 #1
0
ファイル: Program.cs プロジェクト: gobixm/learn
 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();
 }
コード例 #2
0
ファイル: ReportPrinter.cs プロジェクト: gobixm/learn
 public static void Print(Report report)
 {
     Console.WriteLine("---------------------------");
     Console.WriteLine(report.Header);
     Console.WriteLine("---------------------------");
     Console.WriteLine(report.Body);
     Console.WriteLine("---------------------------");
 }
コード例 #3
0
ファイル: HeaderFormatter.cs プロジェクト: gobixm/learn
 public static Report FormatHeader(Report report, string header)
 {
     return new Report("Caption: " + header + " " + DateTime.Now, report.Body);
 }