Example #1
0
        private static void Main(string[] args)
        {
            var director = new Director();
            Builder b1 = new ConcreteBuilder1();
            Builder b2 = new ConcreteBuilder2();

            director.Construct(b1);
            var p1 = b1.GetResult();
            p1.Show();

            director.Construct(b2);
            var p2 = b2.GetResult();
            p2.Show();

            Console.ReadKey();
        }
            public static void RunMain()
            {
                IBuilder builder1 = new Builder1();
                IBuilder builder2 = new Builder2();
                Director director = new Director();
                director.Constructor(builder1);

                Product product = builder1.GetResult();
                product.Display();

                director.Constructor(builder2);
                product = builder2.GetResult();
                product.Display();

            }