コード例 #1
0
        private void buttonRomsPathBrowse_Click(object sender, RoutedEventArgs e)
        {
            string path = CommonDialogsHelper.ShowFolderBrowseDialog(
                "Select ROMs Folder Path:", this.Config.RomsFolderPath);

            if (!String.IsNullOrEmpty(path))
            {
                this.Config.RomsFolderPath = path;
            }
        }
コード例 #2
0
        private void buttonAddGameConfig_Click(object sender, RoutedEventArgs e)
        {
            string gameConfig = CommonDialogsHelper.ShowInputTextBoxDialog(this, "Enter Game Config File Name:", "Add Game Config", "TODO.config");

            if (!String.IsNullOrEmpty(gameConfig))
            {
                this.PlatformConfig.GameConfigs.Add(gameConfig);
                UpdateGameConfigs();
                listGameConfigs.SelectedItem = gameConfig;
            }
        }
コード例 #3
0
        private void buttonAddEmulator_Click(object sender, RoutedEventArgs e)
        {
            string emulator = CommonDialogsHelper.ShowInputTextBoxDialog(this, "Enter Emulator Name:", "Add Game Config");

            if (!String.IsNullOrEmpty(emulator))
            {
                this.PlatformConfig.Emulators.Add(emulator);
                UpdateEmulators();
                listEmulators.SelectedItem = emulator;
            }
        }
コード例 #4
0
        private void buttonAddSyncSelection_Click(object sender, RoutedEventArgs e)
        {
            Platform?platform = (Platform?)CommonDialogsHelper.ShowInputComboBoxDialog(this, "Select Sync Platform:",
                                                                                       EnumHelper.EnumToList <Platform>(), "Add Sync Selection", null, true);

            if (platform.HasValue)
            {
                this.Device.SyncPlatformSelections.Add(platform.Value);
                UpdateSyncSelections();
                listSyncSelections.SelectedItem = platform.Value;
            }
        }
コード例 #5
0
        private async Task <CatalogConfig> LoadConfigAsync()
        {
            string configFolderPath = ReflectionHelper.GetExecutingAssemblyFolderPath();

            var accessProcessor = new LocalAccessProvider();
            var config          = await Config.LoadAsync <CatalogConfig>(accessProcessor, configFolderPath);

            if (config == null)
            {
                string romsFolderPath = CommonDialogsHelper.ShowFolderBrowseDialog(
                    "Select the location of your ROMs folder:");
                if (!String.IsNullOrEmpty(romsFolderPath))
                {
                    config = new CatalogConfig(accessProcessor, configFolderPath, romsFolderPath);
                    await config.SaveAsync();
                }
            }

            return(config);
        }