예제 #1
0
        private void llblLoadGames_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            MessageBox.Show(
                "This feature needs a few changes in the code. \nIf you wanna use it, you will need to go the FrmAdmin and press this LinkLabel\nRemove the 'return' and change the 'PathSteamLibrary' string to your folder with the STEAM games\nreturning.... ");
            return;


            //llblLoadGames.Enabled = false;
            //_scraperHandler.Entries = games;

            string steamLibrary = _infos.PathSteamLibrary;
            var    gameAllPaths = FileHandler.GetDirectoriesSteamGameNames(steamLibrary); // these are only the stream one but we can add the other to this string and it should work the same

            int numberOfAllGames = gameAllPaths.Length;

            lblGamesCountDown.Text = "0 / " + numberOfAllGames;
            // sets the right Values to Progressbar
            pbrImports.Maximum = gameAllPaths.Length;
            pbrImports.Value   = 0;

            // Get inforamtion to all these Game
            foreach (string steamGame in gameAllPaths)
            {
                // Get Game instance with almost all properties besides "Path"!
                Game game = _scrapeHandler.ScrapeData(steamGame.Substring(33));

                // Gets all exe files from this folder and add the first one to Game instance
                var exesWithExe = FileHandler.GetExeWith(steamGame);

                // FInd the biggest exe
                game.Path = FileHandler.GetBiggestFile(exesWithExe);

                // Check the whole list if game name already exits
                // bool isIN = _games.Any(gameInList => gameInList.Name == game.Name);
                bool isIn = false;
                foreach (Game gameInList in _games)
                {
                    if (gameInList.Name != game.Name)
                    {
                        continue;
                    }

                    isIn = true;
                    break;
                }

                // If game.Name doesnt exists => add game
                if (!isIn)
                {
                    _games.Add(game);
                }


                pbrImports.Value += 1;
            }

            pbrImports.Value       = 0;
            lblGamesCountDown.Text = numberOfAllGames.ToString() + " /" + numberOfAllGames.ToString();
            UpdateGameList();
        }