static void Main(string[] args) { ICar objCar = new LuxuryCar(); CarAccesoriesDecorator cad = new SportAccesories(objCar); Console.WriteLine(cad.GetCost()); Console.WriteLine(cad.GetDescription()); Console.WriteLine("Hello from decorator pattern"); Console.ReadLine(); }
static void Main(string[] args) { SportsCar sportsCar = new SportsCar(new BasicCar()); sportsCar.Assemble(); sportsCar.EnableTurboMode(); sportsCar.IsTurboEnabled(); sportsCar.DisableTurboMode(); sportsCar.IsTurboEnabled(); Console.WriteLine(); ICar luxuryCar = new LuxuryCar(new BasicCar()); luxuryCar.Assemble(); }