Esempio n. 1
0
        static void Main(string[] args)
        {
            CarShowroom         factroy      = new TurkeyCarFactroy();
            Car                 car2         = factroy.OrderCar("Sedan");
            ControlPanel        panel        = new ControlPanel();
            Sunroof             sunroof      = new Sunroof(car2);
            SunroofOpenCommand  openCommand  = new SunroofOpenCommand(sunroof);
            SunroofCloseCommand closeCommand = new SunroofCloseCommand(sunroof);

            panel.setCommand(openCommand);
            panel.ButtonWasPressed();
            panel.setCommand(closeCommand);
            panel.ButtonWasPressed();

            Engine    engine    = new Engine();
            Headlight headlight = new Headlight();
            SeatBelt  seatBelt  = new SeatBelt();
            CarFacade facade    = new CarFacade(car2, engine, headlight, seatBelt);

            facade.StartDrive();
            facade.StopDrive();
            Console.ReadLine();
        }
Esempio n. 2
0
 public SunroofCloseCommand(Sunroof sunroof)
 {
     this.sunroof = sunroof;
 }
Esempio n. 3
0
 public SunroofOpenCommand(Sunroof sunroof)
 {
     this.sunroof = sunroof;
 }