static void Main(string[] args) { CarFactory ford_car = new FordFactory(); Client c1 = new Client(ford_car); Console.WriteLine("Kuzov: {0} Max speed {1} is {2} km/hour", c1.KuzovAuto(), c1.ToString(), c1.RunMaxSpeed()); CarFactory audi_car = new AudiFactory(); Client c2 = new Client(audi_car); Console.WriteLine("Kuzov: {0} Max speed {1} is {2} km/hour ", c2.KuzovAuto(), c2.ToString(), c2.RunMaxSpeed()); }
static void Main(string[] args) { CarFactory ford_car = new FordFactory(); Client c1 = new Client(ford_car); Console.WriteLine("Shape: {0} Max speed {1} is {2} km/h", c1.ShapeAuto(), c1.ToString(), c1.RunMaxSpeed()); CarFactory audi_car = AudiFactory.getAudiFactory(); Client c2 = new Client(audi_car); Console.WriteLine("Shape: {0} Max speed {1} is {2} km/h ", c2.ShapeAuto(), c2.ToString(), c2.RunMaxSpeed()); }
static void Main(string[] args) { CarFactory ford_car = new FordFactory(); Client c1 = new Client(ford_car); Console.WriteLine("Максимальная скорость {0} в типе кузова {2} составляет {1} км/час", c1.ToString(), c1.RunMaxSpeed(), c1.TypeBodywork()); CarFactory audi_car = AudiFactory.MyAudi; Client c2 = new Client(audi_car); Console.WriteLine("Максимальная скорость {0} в типе кузова {2} составляет {1} км/час", c2.ToString(), c2.RunMaxSpeed(), c2.TypeBodywork()); Console.ReadKey(); }
static void Main(string[] args) { CarFactory ford_car = new FordFactory(); CarFactory audi_car = new AudiFactory(); Client c1 = new Client(ford_car); Client c2 = new Client(audi_car); Console.WriteLine("Максимальная скорость {0} составляет {1} км/час, а также кузов типа {2}", c1.ToString(), c1.RunMaxSpeed(), c1.GetBodyType()); Console.WriteLine("Максимальная скорость {0} составляет {1} км/час, а также кузов типа {2}", c2.ToString(), c2.RunMaxSpeed(), c2.GetBodyType()); }
static void Main(string[] args) { ICarFactory carFactory = new ToyotaFactory(); ClientFactory client1 = new ClientFactory(carFactory); client1.Run(); carFactory = new FordFactory(); ClientFactory client2 = new ClientFactory(carFactory); client2.Run(); Console.ReadKey(); }
public static void EX2() { AbstractFabricaDeCarro fabrica = new FiatFactory(); AbstractCarroPopular carroPopular = fabrica.CriarCarroPopular(); carroPopular.Detalhes(); fabrica = new FordFactory(); carroPopular = fabrica.CriarCarroPopular(); carroPopular.Detalhes(); fabrica.CriarCarroSedan().Detalhes(); }
public static void Main(string[] args) { Factory nissanFactory = new NissanFactory(); CarDealership carDealership = new CarDealership(nissanFactory); carDealership.OrderVehicles(); Factory fordFactory = new FordFactory(); carDealership = new CarDealership(fordFactory); carDealership.OrderVehicles(); Console.ReadKey(); }
static void Main(string[] args) { ICarFactory carFactory = new ToyotaFactory(); Car myCar = carFactory.CreateCar(); myCar.Info(); Engine myEngine = carFactory.CreateEngine(); myEngine.GetPower(); carFactory = new FordFactory(); myCar = carFactory.CreateCar(); myCar.Info(); myEngine = carFactory.CreateEngine(); myEngine.GetPower(); Console.ReadKey(); }
static void Main(string[] args) { CarFactory ford_car = new FordFactory(); Client c1 = new Client(ford_car); Console.WriteLine("Максимальная скорость {0} составляет {1} км/час с кузовом типа \"{2}\"", c1.ToString(), c1.RunMaxSpeed(), c1.GetBodyStyle()); CarFactory audiCar = new AudiFactory(); Client clientForAudi = new Client(audiCar); Console.WriteLine("Максимальная скорость {0} составляет {1} км/час с кузовом типа \"{2}\"", clientForAudi.Name, clientForAudi.RunMaxSpeed(), clientForAudi.GetBodyStyle()); var Lada = LadaFactory.Factory; Client clientForLada = new Client(Lada); Console.WriteLine("Максимальная скорость {0} составляет {1} км/час с кузовом типа \"{2}\"", clientForLada.Name, clientForLada.RunMaxSpeed(), clientForLada.GetBodyStyle()); }
static void Main(string[] args) { ICarFactory carFactory = new ToyotaFactory(); ClientFactory client1 = new ClientFactory(carFactory); client1.Run(); carFactory = new FordFactory(); ClientFactory client2 = new ClientFactory(carFactory); client2.Run(); Console.WriteLine(""); carFactory = new MercedesFactory(); ClientFactory client3 = new ClientFactory(carFactory); client3.Run(); Console.WriteLine(""); Console.ReadKey(); }