コード例 #1
0
 public HomeTheaterFacade(Amplifier amp, Tuner tuner, DvdPlayer dvd, CdPlayer cd, Projector projector,
                          TheaterLights lights, Screen screen, PopcornPopper popper)
 {
     this.amp       = amp;
     this.tuner     = tuner;
     this.dvd       = dvd;
     this.cd        = cd;
     this.projector = projector;
     this.screen    = screen;
     this.lights    = lights;
     this.popper    = popper;
 }
コード例 #2
0
        static void Main(string[] args)
        {
            Amplifier     amp       = new Amplifier();
            Tuner         tuner     = new Tuner();
            DvdPlayer     dvd       = new DvdPlayer();
            CdPlayer      cd        = new CdPlayer();
            Projector     projector = new Projector();
            TheaterLights lights    = new TheaterLights();
            Screen        screen    = new Screen();
            PopcornPopper popper    = new PopcornPopper();

            HomeTheaterFacade homeTheater = new HomeTheaterFacade(amp, tuner, dvd, cd, projector, lights, screen, popper);

            homeTheater.WatchMovie("Raider of the Lost Ark");
            homeTheater.EndMovie();

            RadioFacade radio = new RadioFacade(amp, tuner);

            radio.ListenToRadio(800);
            radio.TurnOffRadio();
        }
コード例 #3
0
 public void SetDvd(DvdPlayer dvd)
 {
     dvd.TurnOn();
 }
コード例 #4
0
 public Amplifier()
 {
     tuner     = new Tuner();
     dvdPlayer = new DvdPlayer();
     cdPlayer  = new CdPlayer();
 }