예제 #1
0
        private void btnGetGameData_Click(object sender, EventArgs e)
        {
            if (_selectedGame != null)
            {
                if (_game == null || _game.GameURI != _selectedGame.Uri)
                {
                    _game = _scraper.RetrieveGameData(_selectedGame.Uri);

                    if (_game == null)
                    {
                        return;
                    }

                    //Retrieving first available screenshot
                    if (_game.Screenshots != null && _game.Screenshots.Count > 0)
                    {
                        _scraper.DownloadFileCompleted += _scraper_DownloadFileCompleted;
                        _scraper.DownloadMedia(_game.Screenshots[0], Application.StartupPath + "\\tmp.img");
                    }
                }
                else if (_game != null)
                {
                    CustomMessageBox cmb = new CustomMessageBox(_manager.Translator.GetTranslatedMessage(_manager.AppSettings.Language, 77, "Download Completed!!!"),
                                                                _manager.Translator.GetTranslatedMessage(_manager.AppSettings.Language, 59, "Information"),
                                                                MessageBoxDialogButtons.Ok, MessageBoxDialogIcon.Information, false, false);
                    cmb.ShowDialog();
                    cmb.Dispose();
                }
            }
        }
예제 #2
0
        private void btnDownloadGame_Click(object sender, EventArgs e)
        {
            string path = _dialogsHelpers.OpenFolder(_folderSelectionText, string.Empty, true, string.Empty);

            if (path == string.Empty)
            {
                return;
            }

            lblStatus.Visible   = false;
            pgbDownload.Visible = true;
            pgbDownload.Value   = 0;

            _helper.DownloadMedia(_downloadURI, string.Format("{0}\\{1}", path, _destinationFile));
        }