public HomeTheaterFacade(Amplifier amp, Tuner tuner, CdPlayer cdPlayer, DvdPlayer dvdPlayer, TheaterLights lights, Screen screen, PopcornPopper popper)
 {
     this.amplifier     = amp;
     this.tuner         = tuner;
     this.cdPlayer      = cdPlayer;
     this.dvdPlayer     = dvdPlayer;
     this.theaterLights = lights;
     this.screen        = screen;
     this.popcornPopper = popper;
 }
예제 #2
0
 public HomeTheaterFacade(Amplifier amp, Tuner tuner, DvdPlayer dvd, CdPlayer cd, Projector projector, Screen screen, TheaterLights lights, PopcornPopper popper)
 {
     _amp       = amp;
     _tuner     = tuner;
     _dvd       = dvd;
     _cd        = cd;
     _projector = projector;
     _lights    = lights;
     _screen    = screen;
     _popper    = popper;
 }
예제 #3
0
 public HomeTheatreFacade(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.lights    = lights;
     this.screen    = screen;
     this.popper    = popper;
 }
        private static void Main()
        {
            var amplifier = new Amplifier();
            var tuner     = new Tuner();
            var dvd       = new DvdPlayer();
            var cd        = new CdPlayer();
            var projector = new Projector();
            var lights    = new TheaterLights();
            var screen    = new Screen();
            var popper    = new PopcornPopper();

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

            homeTheater.WatchMovie("Raiders of the Lost Ark");
            homeTheater.EndMovie();
        }
예제 #5
0
        //外观模式设计基于子系统设计简单的接口方便客户端调用子系统的功能
        static void Main(string[] args)
        {
            Amplifier     amp       = new Amplifier();
            DvdPlayer     dvd       = new DvdPlayer(amp);
            CDPlayer      cd        = new CDPlayer(amp);
            Projector     projector = new Projector(dvd);
            Tuner         tuner     = new Tuner(amp);
            Screen        screen    = new Screen();
            TheaterLights lights    = new TheaterLights();
            PopcornPopper popper    = new PopcornPopper();

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

            homeTheater.WatchMovie("Raiders of the Lost Ark");
            homeTheater.EndMovie();
        }
예제 #6
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();
            HomeTheatreFacade homeTheater = new HomeTheatreFacade(amp, tuner, dvd, cd, projector, lights, screen, popper);


            homeTheater.WatchMovie("Avatar");
            homeTheater.EndMovie();
        }
예제 #7
0
 public HomeTheaterFacade(PopcornPopper popper,
                          TheaterLights lights,
                          Screen screen,
                          DvdPlayer dvd,
                          CdPlayer cd,
                          Tuner tuner,
                          Projector projector,
                          Amplifier amp)
 {
     Popper    = popper;
     Lights    = lights;
     Screen    = screen;
     Dvd       = dvd;
     Cd        = cd;
     Tuner     = tuner;
     Projector = projector;
     Amp       = amp;
 }
예제 #8
0
        static void Main(string[] args)
        {
            PopcornPopper popper    = new PopcornPopper();
            TheaterLights lights    = new TheaterLights();
            Screen        screen    = new Screen();
            DvdPlayer     dvd       = new DvdPlayer();
            CdPlayer      cd        = new CdPlayer();
            Tuner         tuner     = new Tuner();
            Projector     projector = new Projector(dvd);
            Amplifier     amp       = new Amplifier(tuner, dvd, cd);

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

            facade.WatchMovie();
            Console.WriteLine();
            facade.EndMovie();
        }
예제 #9
0
        static void Main(string[] args)
        {
            // Initialize components
            var popper    = new PopcornPopper();
            var lights    = new TheaterLights();
            var screen    = new Screen();
            var projector = new Projector();
            var amp       = new Amplifier();
            var dvd       = new DvdPlayer();

            // Watch "Raiders of the Lost Ark"
            var movieTitle = "Raiders of the Lost Ark";

            Console.WriteLine($"Get ready to watch a movie...");
            popper.On();
            lights.Dim(10);
            screen.Down();
            projector.On();
            projector.WideScreenMode();
            amp.On();
            amp.setDvd(dvd);
            amp.SetSurroundSound();
            amp.SetVolume(5);
            dvd.On();
            dvd.Play(movieTitle);

            // End Movie
            Console.WriteLine("Shutting movie theater down");
            popper.Off();
            lights.On();
            screen.Up();
            projector.Off();
            amp.Off();
            dvd.Stop();
            dvd.Eject();
            dvd.Off();
        }