static void Main(string[] args) { Report.Report report; ReportDirector director = new ReportDirector(); ReportPdf pdf = new ReportPdf(); report = director.MakeReport(pdf); report.DisplayReport(); ReportExcel excel = new ReportExcel(); report = director.MakeReport(excel); report.DisplayReport(); }
static void Main(string[] args) { // Client Code Report report; ReportDirector reportDirector = new ReportDirector(); // Construct and display Reports PDFReport pdfReport = new PDFReport(); report = reportDirector.MakeReport(pdfReport); report.DisplayReport(); Console.WriteLine("-------------------"); ExcelReport excelReport = new ExcelReport(); report = reportDirector.MakeReport(excelReport); report.DisplayReport(); Console.ReadKey(); }
public static void Run() { Report report; ReportDirector reportDirector = new ReportDirector(); // Construct and display Reports PDFReport pdfReport = new PDFReport(); report = reportDirector.MakeReport(pdfReport); report.DisplayReport(); Console.WriteLine("-------------------"); ExcelReport excelReport = new ExcelReport(); report = reportDirector.MakeReport(excelReport); report.DisplayReport(); Console.ReadKey(); }
static void Main(string[] args) { var excelBuilder = new ExcelReportBuilder(); var pdfBuilder = new PDFReportBuilder(); ReportDirector director = new ReportDirector(); director.Builder = excelBuilder; director.BuildReport(); var excelReport = excelBuilder.GetReport(); director.Builder = pdfBuilder; director.BuildReport(); var pdfReport = pdfBuilder.GetReport(); Process(excelReport); Process(pdfReport); }