Example #1
0
        //##################    Scaning gog.com for games owned    ##################

        private async void GetGames()
        {
            platforms = new Dictionary <int, string>();

            int i = 0;

            foreach (IPlatform platform in PluginHelper.DataManager.GetAllPlatforms())
            {
                platforms.Add(i, platform.Name);
                i++;
            }

            ImportOptions options = new ImportOptions(this);

            options.Show();
            await options.ok.Task;

            options.Close();
            this.skipByTitle  = options.skipByTitle;
            this.skipImported = options.skipImported;
            this.mode         = options.mode;
            this.galaxyPath   = options.galaxyPath;
            this.platform     = options.platform;
            options.Dispose();

            await Scan_Library();

            MessageBox.Show("Skip " + skipGogId.Count.ToString() + " games already imported and " + skipTitle.Count.ToString() + " games by title.");

            ProgressForm progressForm = new ProgressForm();

            progressForm.Show();
            await progressForm.ShowProgress(GetGames_doWork, "Collecting Game Information");

            progressForm.Close();
            progressForm.Dispose();

            if (mode.Equals(Mode.startWithGalaxy))
            {
                GameImportForm importForm = new GameImportForm(this);
                importForm.Show();
            }
            else if (mode.Equals(Mode.linkToDownload))
            {
                GameImportForm2 importForm = new GameImportForm2(this);
                importForm.Show();
            }

            webClient.Dispose();
        }
Example #2
0
        //##################    Scaning gog.com for games owned    ##################

        private async void GetGames()
        {
            platforms = new Dictionary <int, string>();

            int i = 0;

            foreach (IPlatform platform in PluginHelper.DataManager.GetAllPlatforms())
            {
                platforms.Add(i, platform.Name);
                i++;
            }

            // if platforms changed reset
            if (platform == null || !platforms[platformNo].Equals(platform))
            {
                platformNo = 0;
                platform   = platforms[platformNo];
            }

            ImportOptions options = new ImportOptions(this);

            options.Show();
            await options.ok.Task;

            options.Close();
            this.skipByTitle  = options.skipByTitle;
            this.skipImported = options.skipImported;
            this.mode         = options.mode;
            this.galaxyPath   = options.galaxyPath;
            this.platformNo   = options.platformNo;
            this.platform     = platforms[platformNo];
            options.Dispose();

            await Scan_Library();

            ProgressForm progressForm = new ProgressForm("Collecting Game Information");

            progressForm.Show();
            await progressForm.ShowProgress(GetGames_doWork);

            progressForm.Close();
            progressForm.Dispose();

            if (errorForm != null)
            {
                errorForm.Show();
                await errorForm.ok.Task;
                errorForm.Dispose();
            }

            if (gamesFound != null || gamesFound.Count > 0)
            {
                gamesFound.Sort((x1, x2) => x1.title.CompareTo(x2.title));

                if (mode.Equals(Mode.startWithGalaxy))
                {
                    GameImportForm importForm = new GameImportForm(this);
                    importForm.Show();
                }
                else if (mode.Equals(Mode.linkToDownload))
                {
                    GameImportForm2 importForm = new GameImportForm2(this);
                    importForm.Show();
                }
            }

            webClient.Dispose();
        }