Exemple #1
0
 public HomeTheatreFacade(Light light, Projector projector, AudioAmplifier audioamp, PopcornMaker popcornMaker)
 {
     this.light          = light;
     this.projector      = projector;
     this.audioAmplifier = audioamp;
     this.popcornMaker   = popcornMaker;
 }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Chapter 7 - Facade Pattern:");

            //Appliances
            Light          light        = new Light();
            Projector      projector    = new Projector();
            AudioAmplifier audioAmp     = new AudioAmplifier();
            PopcornMaker   popcornMaker = new PopcornMaker();

            //Theatre Facade Object
            HomeTheatreFacade homeTheatre = new HomeTheatreFacade(light, projector, audioAmp, popcornMaker);

            //Interact with Facade
            homeTheatre.PrepareMovie();
            homeTheatre.WatchMovie();
            homeTheatre.TurnOff();

            Console.ReadKey();
        }