Exemplo n.º 1
0
        public void ClientMain() //IFactory<Brand> factory)
        {
            IFactory <Brand> factory = new Factory <Brand>();

            IBag   bag   = factory.CreateBag();
            IShoes shoes = factory.CreateShoes();

            Console.WriteLine("I bought a Bag which is made from " + bag.Material);
            Console.WriteLine("I bought some shoes which cost " + shoes.Price);
        }
Exemplo n.º 2
0
        public void ClientMain( )
        {
            // The following line is not possible without new() constraint:
            IFactory <Brand> factory = new Factory <Brand>( );

            IBag   bag   = factory.CreateBag( );
            IShoes shoes = factory.CreateShoes( );

            Console.WriteLine("I bought a Bag which is made from " + bag.Material);
            Console.WriteLine("I bought some shoes which cost " + shoes.Price);
        }
Exemplo n.º 3
0
        public void ClientMain()
        {
            IFactory <Brand> factory = new Factory <Brand>();

            IBags bag = factory.CreateBag();

            IShoes shoes = factory.CreateShoes();

            Console.WriteLine(" bag material is - > " + bag.Material);
            Console.WriteLine(" Price is - > " + shoes.Price);
        }
Exemplo n.º 4
0
        public void ClientMain()
        {
            IFactory <Brand> factory = new Factory <Brand>();

            ITrackSuits tracksuits = factory.CreateSuits();
            IShoes      shoes      = factory.CreateShoes();

            Console.WriteLine("Tha Adidas tracksuit is made of " + tracksuits.Material);
            Console.WriteLine("Tha Nike tracksuit is made of " + tracksuits.Material);
            Console.WriteLine("The shoes are costing " + shoes.Price);
        }
Exemplo n.º 5
0
        public void ClientMain()
        { //IFactory<Brand> factory)
            IFactory <T> factory = new Factory <T>();

            IBag   bag   = factory.CreateBag();
            IShoes shoes = factory.CreateShoes();
            IBelts belts = factory.CreateBelts();

            Console.WriteLine("I bought a Bag which is made from " + bag.Material);
            Console.WriteLine("I bought some shoes which cost " + shoes.Price);
            Console.WriteLine("I bought a belt with length " + belts.Length);
        }
Exemplo n.º 6
0
        public void Run()
        {
            IWearFactory wear = new BlackWearFactory();

            IClothes  clothes  = wear.CreateClothes();
            ITrousers trousers = wear.CreateTrousers();
            IShoes    shoes    = wear.CreateShoes();

            clothes.Wear();
            trousers.Wear();
            shoes.Wear();
        }
Exemplo n.º 7
0
 public void getDressed(IShoes shoes, IDress dress)
 {
     this.dress = dress;
     this.shoes = shoes;
 }
Exemplo n.º 8
0
 static public void newShoes(IShoes s)
 {
     s.addShoes("Sneaker");
     s.browsShoes();
 }