Beispiel #1
0
        private static void Maintenance(char keepPlaying = 'y')
        {
            if (!keepPlaying.Equals('y'))
            {
                ShowMenu();
            }

            Console.Clear();
            Console.WriteLine("MAINTENANCE");
            var option        = ShowAlbums();
            var selectedAlbum = _Configuration.Albums[option - 1];

            Console.WriteLine("Selected album: {0} ({1}).", selectedAlbum.Name, selectedAlbum.Media.GetMediaType());
            Console.WriteLine("Changing media to: {0}...", selectedAlbum.Media.GetMediaType().ToString());
            InjectionFactory.Instance.ChangeMediaType(selectedAlbum.Media.GetMediaType());
            _JuckeBoxPlayer.ChangeSelector(InjectionFactory.Instance.Get <ISelectorService>());
            Console.Clear();
            Console.WriteLine("SELECT A MAINTENANCE OPTION");
            option = ShowMaintenanceOptions(_Configuration.Albums[option - 1]);
            var selectedOption = selectedAlbum.Media.MaintenanceOptions[option - 1];

            Console.WriteLine("Selected option: {0}.", selectedOption);
            _JuckeBoxPlayer.Maintenance(selectedAlbum, option - 1);
            Console.WriteLine();

            Console.Write("Would you like to keep doing maintenance ? (y/n) : ");
            keepPlaying = Console.ReadKey().KeyChar;
            Maintenance(keepPlaying);
        }