Exemple #1
0
        private bool GetHyperspinFilesForMenu(string mediaPath, string romName, string filter = "*.*")
        {
            var pathToScan = Path.Combine(_settingsRepo.HypermintSettings.HsPath, Root.Media, romName, mediaPath);

            if (!Directory.Exists(pathToScan))
            {
                Directory.CreateDirectory(pathToScan);
            }

            CurrentMediaFiles.Clear();

            foreach (var item in Directory.EnumerateFiles(pathToScan, filter))
            {
                CurrentMediaFiles.Add(new MediaFile
                {
                    Name      = Path.GetFileNameWithoutExtension(item),
                    FileName  = Path.GetFullPath(item),
                    Extension = Path.GetExtension(item)
                });
            }

            if (CurrentMediaFiles.Count == 0)
            {
                return(false);
            }
            else
            {
                FilesForGame.MoveCurrentToFirst();
                return(true);
            }
        }
Exemple #2
0
        private bool GetHyperspinFilesForGame(string mediaPath, string filter = "*.*")
        {
            var    mainMenu = _selectedService.CurrentSystem.ToLower().Contains("main menu");
            string selected = "";

            selected = _selectedService.CurrentSystem;

            var pathToScan = Path.Combine(_settingsRepo.HypermintSettings.HsPath,
                                          Root.Media, selected, mediaPath);

            CurrentMediaFiles.Clear();

            if (Directory.Exists(pathToScan))
            {
                foreach (var item in Directory.EnumerateFiles(pathToScan, filter))
                {
                    CurrentMediaFiles.Add(new MediaFile
                    {
                        Name      = Path.GetFileNameWithoutExtension(item),
                        FileName  = Path.GetFullPath(item),
                        Extension = Path.GetExtension(item)
                    });
                }
            }

            if (CurrentMediaFiles.Count == 0)
            {
                return(false);
            }
            else
            {
                FilesForGame.MoveCurrentToFirst();
                return(true);
            }
        }