コード例 #1
0
        private void addRomPackInDirectoryStructureToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                FolderBrowserDialog open = new FolderBrowserDialog();
                open.SelectedPath = Environment.CurrentDirectory;

                if (open.ShowDialog() == DialogResult.Cancel)
                {
                    return;
                }

                if (open.SelectedPath.Length == 0)
                {
                    return;
                }

                Platform selected = null;

                if (FormChoose.ChoosePlatform(out selected))
                {
                    RomFunctions.AddRomPacksFromDirectory(selected, open.SelectedPath);
                    FilterRoms();
                }
            }
            catch (Exception ex)
            {
                FormCustomMessage.ShowError(ex.Message);
            }
        }
コード例 #2
0
        public static bool RescanRoms(Platform platform)
        {
            if (string.IsNullOrEmpty(platform.DefaultRomPath) || string.IsNullOrEmpty(platform.DefaultRomExtensions))
            {
                return(false);
            }

            var added           = RomFunctions.AddRomsFromDirectory(platform, platform.DefaultRomPath);
            var addedAnyRomPack = RomFunctions.AddRomPacksFromDirectory(platform, platform.DefaultRomPath);

            if (added || addedAnyRomPack)
            {
                XML.SaveXmlRoms(platform.Name);
            }

            return(added || addedAnyRomPack);
        }