示例#1
0
            static void Main(string[] args)
            {
                Amp amp = new Amp();
                amp.Vol = 1;
                do
                {
                    Console.WriteLine("Amp is set on volume " + amp.Vol);
                    Console.WriteLine("Enter new volume:  ");
                    amp.Vol = int.Parse(Console.ReadLine());
                } while (true);


            }
示例#2
0
 public void WatchMovie(string movie)
 {
     Console.WriteLine("Get Ready to watch a movie...");
     Popper.On();
     Popper.Pop();
     Lights.Dim();
     Screen.Down();
     Projector.On();
     Projector.WideScreenModel();
     Amp.On();
     Amp.SetSurroundSound();
     Amp.SetVolume();
     DVD.On();
     DVD.Play();
 }
 public Guitar(int level, string effectName) // BASIC
 {
     try
     {
         _amp       = new Amp();
         _amp.Level = level;
         _effect    = new Effect(effectName);
     }
     catch
     {
         _amp?.Dispose();
         _effect?.Dispose();
         throw;
     }
 }
示例#4
0
        public object EndMovie()
        {
            var endMovie = new StringBuilder();

            endMovie.Append("Shutting movie theater down...\n");
            endMovie.Append(Popper.Off());
            endMovie.Append(Lights.On());
            endMovie.Append(Screen.Up());
            endMovie.Append(Projector.Off());
            endMovie.Append(Amp.Off());
            endMovie.Append(Dvd.Stop());
            endMovie.Append(Dvd.Eject());
            endMovie.Append(Dvd.Off());

            return(endMovie.ToString());
        }
        public string EndMovie()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("Shutting movie theater down ...");
            sb.AppendLine(Popper.Off());
            sb.AppendLine(Lights.On());
            sb.AppendLine(Screen.Up());
            sb.AppendLine(Projector.Off());
            sb.AppendLine(Amp.Off());
            sb.AppendLine(Dvd.Stop());
            sb.AppendLine(Dvd.Eject());
            sb.AppendLine(Dvd.Off());

            return(sb.ToString());
        }
        public void ConnectAmp() // STRONG
        {
            Amp tempAmp = new Amp();

            try
            {
                tempAmp.Level = 11;
            }
            catch
            {
                tempAmp.Dispose();
                throw;
            }
            _amp?.Dispose();
            _amp = tempAmp;
        }
示例#7
0
        public object WatchMovie(string movie)
        {
            var watchMovie = new StringBuilder();

            watchMovie.Append("Get ready to watch a movie...\n");
            watchMovie.Append(Popper.On());
            watchMovie.Append(Popper.Pop());
            watchMovie.Append(Lights.Dim(10));
            watchMovie.Append(Screen.Down());
            watchMovie.Append(Projector.On());
            watchMovie.Append(Projector.WideScreenMode());
            watchMovie.Append(Amp.On());
            watchMovie.Append(Amp.SetDvd(Dvd));
            watchMovie.Append(Amp.SetSurroundSound());
            watchMovie.Append(Amp.SetVolume(15));
            watchMovie.Append(Dvd.On());
            watchMovie.Append(Dvd.Play(movie));
            return(watchMovie.ToString());
        }
        public string WatchMovie(string movie)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("Get ready to watch a movie ...");
            sb.AppendLine(Popper.On());
            sb.AppendLine(Popper.Pop());
            sb.AppendLine(Lights.Dim(10));
            sb.AppendLine(Screen.Down());
            sb.AppendLine(Projector.On());
            sb.AppendLine(Projector.WideScreenMode());
            sb.AppendLine(Amp.On());
            sb.AppendLine(Amp.SetDvd());
            sb.AppendLine(Amp.SetSurroundSound());
            sb.AppendLine(Amp.SetVolume(5));
            sb.AppendLine(Dvd.On());
            sb.AppendLine(Dvd.Play(movie));

            return(sb.ToString());
        }
        public void Config(string path) // STRONG
        {
            Amp    tempAmp    = null;
            Effect tempEffect = null;

            try
            {
                using (var reader = File.OpenText(path))
                {
                    tempAmp       = new Amp();
                    tempAmp.Level = int.Parse(reader.ReadLine());
                    tempEffect    = new Effect(reader.ReadLine());
                }

                Util.Swap(ref _amp, ref tempAmp);
                Util.Swap(ref _effect, ref tempEffect);
            }
            finally
            {
                tempAmp?.Dispose();
                tempEffect?.Dispose();
            }
        }
示例#10
0
 public HomeTheaterFacade(Amp amp, Popper popper, Screen screen)
 {
     _amp    = amp;
     _popper = popper;
     _screen = screen;
 }
示例#11
0
 public AcOutlet(Amp amps)
 {
     this._amps = amps;
 }
示例#12
0
            public MAmp GetPower()
            {
                Amp amps = this._socket.GetPower();

                return((MAmp)(amps * 100));
            }
 public void ConnectAmp()
 {
     _amp?.Dispose();
     _amp       = new Amp();
     _amp.Level = 11;
 }