示例#1
0
        static void Main(string[] args)
        {
            var facade = new HomeTheaterFacade(new Amplifier(), new DvdPlayer(), new Projector(), new TheaterLights(), new Screen(), new PopcornPopper());

            facade.WatchMovie("Ready Player One");
            facade.EndMovie();

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            var amp       = new Amplifier();
            var tuner     = new Tuner();
            var dvd       = new DvdPlayer();
            var cd        = new CdPlayer();
            var projector = new Projector();
            var screen    = new Screen();
            var lights    = new TheaterLights();
            var popper    = new PopcornPopper();

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

            homeTheater.WatchMovie("Raider of the Lost Ark");
            homeTheater.EndMovie();
        }
        static void Main(string[] args)
        {
            Amplifier     amp       = new Amplifier();
            CdPlayer      cd        = new CdPlayer();
            DvdPlayer     dvd       = new DvdPlayer();
            PopcornPopper popper    = new PopcornPopper();
            Projector     projector = new Projector();
            Screen        screen    = new Screen();
            TheaterLights lights    = new TheaterLights();
            Tuner         tuner     = new Tuner();

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

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

            Console.Read();
        }
示例#4
0
        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();
        }
示例#5
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Enter the name of a Movie you would like to watch: ");
            var movie = Console.ReadLine();

            var amp       = new Amplifier("Denon Amplifier");
            var dvd       = new DvdPlayer("Blu Ray Player", amp);
            var projector = new Projector("Epson Projector", dvd);
            var lights    = new TheaterLights("Rad Lights");
            var screen    = new Screen("Silver Ticket 100 Movie Screen");
            var popper    = new PopcornPopper("Pop Pop!");

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

            Console.WriteLine(homeTheater.WatchMovie(movie));
            Console.WriteLine("Please press Enter when movie has ended.");
            Console.ReadKey();
            Console.WriteLine(homeTheater.EndMovie());

            Console.ReadKey();
        }