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); }
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); }
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); }
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); }
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); }
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(); }
public void getDressed(IShoes shoes, IDress dress) { this.dress = dress; this.shoes = shoes; }
static public void newShoes(IShoes s) { s.addShoes("Sneaker"); s.browsShoes(); }