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;
 }
Beispiel #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;
 }
 public HomeTheaterFacade(Amplifier amplifier, Tuner tuner, DvdPlayer dvdPlayer,
                          CdPlayer cdPlayer, TheteaterLight theaterLights, PopcornPopper popcornPopper,
                          Screen screen, Projector projector)
 {
     _amplifier     = amplifier;
     _tuner         = tuner;
     _dvdPlayer     = dvdPlayer;
     _cdPlayer      = cdPlayer;
     _theaterLights = theaterLights;
     _popcornPopper = popcornPopper;
     _screen        = screen;
     _projector     = projector;
 }
 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;
 }
        static void Main(string[] args)
        {
            var dimmer      = new Dimmer();
            var dvdPlayer   = new DvdPlayer();
            var dvd         = new Dvd("Gone with the Wind 2 : Electric Bugaloo");
            var homeTheater = new HomeTheatreFacade(dimmer, dvd, dvdPlayer);

            homeTheater.WatchMovie();
            Console.WriteLine();
            homeTheater.Pause();
            Console.WriteLine();
            homeTheater.Resume();
            Console.WriteLine();
            homeTheater.Pause();
        }
Beispiel #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();
        }
Beispiel #7
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();
        }
        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();
        }
Beispiel #9
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();
        }
Beispiel #10
0
        private static void Main()
        {
            Dimmer            dimmer      = new Dimmer();
            DvdPlayer         dvdPlayer   = new DvdPlayer();
            Dvd               dvd         = new Dvd(name: "The Matrix");
            HomeTheatreFacade homeTheater = new HomeTheatreFacade(dimmer: dimmer, dvd: dvd, dvdPlayer: dvdPlayer);

            homeTheater.WatchMovie();
            Console.WriteLine();

            homeTheater.Pause();
            Console.WriteLine();

            homeTheater.Resume();
            Console.WriteLine();

            homeTheater.Pause();
        }
Beispiel #11
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;
 }
Beispiel #12
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();
        }
Beispiel #13
0
 public HomeTheatreFacade(Dimmer dimmer, Dvd dvd, DvdPlayer dvdPlayer)
 {
     this.dvd       = dvd;
     this.dimmer    = dimmer;
     this.dvdPlayer = dvdPlayer;
 }
Beispiel #14
0
 public Amplifier(Tuner tuner, CdPlayer cdPlayer, DvdPlayer dvdPlayer)
 {
     this.Tuner     = tuner;
     this.CdPlayer  = cdPlayer;
     this.DvdPlayer = dvdPlayer;
 }
Beispiel #15
0
 public void SetDvd(DvdPlayer dvd)
 {
     Console.WriteLine($"{_description} setting DVD player to {_dvd}");
     _dvd = dvd;
 }
Beispiel #16
0
 public void SetDvd(DvdPlayer dvd)
 {
     Console.WriteLine($"{dvd} is in");
 }
 internal void SetDvd(DvdPlayer dvd)
 {
     this.dvdPlayer = dvd;
     Console.WriteLine("Top-O-Line Amplifier setting DVD player to Top-O-Line DVD Player");
 }
Beispiel #18
0
 public Projector(DvdPlayer dvdPlayer)
 {
     this.dvdPlayer = dvdPlayer;
 }
Beispiel #19
0
 public Projector(DvdPlayer dvdPlayer)
 {
     DvdPlayer = dvdPlayer;
 }
Beispiel #20
0
 public Amplifier(Tuner tuner, DvdPlayer dvdPlayer, CdPlayer cdPlayer)
 {
     Tuner     = tuner;
     DvdPlayer = dvdPlayer;
     CdPlayer  = cdPlayer;
 }
Beispiel #21
0
 public void SetDvd(DvdPlayer dvd)
 {
     Console.WriteLine($"Top-O-Line Amplifier setting DVD player to {dvd.Name} DVD Player");
 }