public void AddEngine(ICar1 car) { if (car is BMWCar) { BMWCar BMWCar = (BMWCar)car; BMWCar.Engine = "Petrol Engine"; Console.WriteLine("PetrolCarDecorator added Petrol Engine to the Car : " + car); } }
public PetrolCarDecorator(ICar1 car) : base(car) { }
public CarDecorator(ICar1 car) { this.car = car; }