コード例 #1
0
ファイル: Program.cs プロジェクト: owenhuang91/DesignPattern
        static void Main(string[] args)
        {
            Amplifier amp = new Amplifier("Top-O-Line Amplifier");
            Tuner tuner = new Tuner("Top-O-Line AM/FM Tuner", amp);
            DvdPlayer dvd = new DvdPlayer("Top-O-Line DVD Player", amp);
            CdPlayer cd = new CdPlayer("Top-O-Line CD Player", amp);
            Projector projector = new Projector("Top-O-Line Projector", dvd);
            TheaterLights lights = new TheaterLights("Theater Ceiling Lights");
            Screen screen = new Screen("Theater Screen");
            PopcornPopper popper = new PopcornPopper("Popcorn Popper");

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

            homeTheater.watchMovie("Raiders of the Lost Ark");
            homeTheater.endMovie();

            Console.ReadLine();
        }
コード例 #2
0
 public HomeTheaterFacade(Amplifier amp, Tuner tuner, DvdPlayer dvd, CdPlayer cd, Projector projector,
                          TheaterLights lights, Screen screen, PopcornPopper popper)
 {
     _amp       = amp;
     _tuner     = tuner;
     _dvd       = dvd;
     _cd        = cd;
     _projector = projector;
     _lights    = lights;
     _screen    = screen;
     _popper    = popper;
 }
コード例 #3
0
 public HomeTheaderFacade(Amplifier amplifier, Tuner tuner, DvdPlayer dvdPlayer, Projector projector)
 {
     this.amplifier = amplifier;
     this.tuner     = tuner;
     this.dvdPlayer = dvdPlayer;
     this.projector = projector;
 }