Пример #1
0
        public HomeTheaterFacade(Amplifier amp, 
			Tuner tuner, 
			DvdPlayer dvd, 
			CdPlayer cd, 
			Projector projector, 
			Screen screen,
			TheaterLights lights,
			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 amf = new Amplifier("Amplifier");
     Tuner tun = new Tuner("Tuner",amf);
     DvdPlayer dvd=new DvdPlayer("DVD",amf);
     CdPlayer cd =new CdPlayer("CD",amf);
     Projector projector=new Projector("Projector",dvd);
     TheaterLights lights=new TheaterLights("TheaterLights");
     Screen screen=new Screen("Screen");
     PopcornPopper popper=new PopcornPopper("PopcornPopper");
     HomeTheaterFacade homeTheatre = new HomeTheaterFacade(amf,tun,dvd,cd, projector, screen,lights, popper);
     Console.WriteLine(homeTheatre.ListenToRadio(4.5));
     Console.WriteLine(homeTheatre.ListenToCd("Bony M"));
     Console.WriteLine(homeTheatre.EndRadio());
     Console.WriteLine(homeTheatre.EndCd());
     Console.WriteLine(homeTheatre.WatchMovie("Animate"));
     Console.WriteLine(homeTheatre.EndMovie());
     Console.ReadKey();
 }
Пример #3
0
 public string SetTuner(Tuner tuner)
 {
     this.tuner = tuner;
     return description + " setting tuner to " + tuner.Description + "\n";
 }