Пример #1
0
        public void UsageMethod()
        {
            Director director = new Director();
            IBuilder b1       = new ConcreteBuilder1();
            IBuilder b2       = new ConcreteBuilder2();

            //---Construct two products
            director.Construct(b1);
            Product p1 = b1.GetResult();

            p1.Show();
            director.Construct(b2);
            Product p2 = b2.GetResult();

            p2.Show();
        }
 public void UsageMethod()
 {
     Director director = new Director();
     IBuilder b1 = new ConcreteBuilder1();
     IBuilder b2 = new ConcreteBuilder2();
     //---Construct two products
       director.Construct(b1);
     Product p1 = b1.GetResult();
     p1.Show();
     director.Construct(b2);
     Product p2 = b2.GetResult();
     p2.Show();
 }