Example #1
0
        static void Main(string[] args)
        {
            Director director = new Director();
            Builder  builder1 = new ConcreteBuilder1();
            Builder  builder2 = new ConcreteBuilder2();

            director.Construct(builder1);
            Product p1 = builder1.GetResult();

            p1.Show();

            director.Construct(builder2);
            Product p2 = builder2.GetResult();

            p2.Show();

            Console.Read();
        }
Example #2
0
            public static void Test()
            {
                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();
            }