Exemplo n.º 1
0
        public MatchGamesDialog(CatalogEditor catalogEditor)
        {
            InitializeComponent();
            App.SetWindowFont(this);
            this.Closing += MatchGamesDialog_Closing;

            this.CatalogEditor = catalogEditor;
            this.Games         = this.CatalogEditor.GatherIncompleteGames();

            foreach (var scraper in ScraperEngine.GatherScrapers(this.CatalogEditor.Config.FolderPath))
            {
                comboScraper.Items.Add(scraper);
            }
            if (comboScraper.Items.Count > 0)
            {
                comboScraper.SelectedIndex = 0;
            }
        }
        public async Task LoadAsync(Game game)
        {
            // Record.
            this.GameToMatch = game;
            textQuery.Text   = await ScraperEngine.GetGameNameAsync(game.Platform, game.GameFilename);

            comboPlatform.SelectedItem = game.Platform;

            // Load the scrapers.
            var scrapers = ScraperEngine.GatherScrapers(this.CatalogEditor.Config.FolderPath);

            if (scrapers.Count > 0)
            {
                foreach (var scraper in scrapers)
                {
                    comboScraper.Items.Add(scraper);
                }
                comboScraper.SelectedIndex = 0;
            }
        }