Example #1
0
        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();
        }
Example #2
0
        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();
        }
Example #3
0
        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();
        }
Example #4
0
        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);
        }