Ejemplo n.º 1
0
 private void SearchFoldersForGames(List <string> fs)
 {
     using (BackgroundWorker bw = new BackgroundWorker())
     {
         bw.DoWork += delegate
         {
             foreach (string folder in fs)
             {
                 string[]  paths = GameSuggestions.GetGameFolders(folder);
                 GameAdder ga    = new GameAdder();
                 ga.DataReady += AdderOnDataReady;
                 ga.AddGames(paths);
             }
             workingProgress = WorkingProgress.BusyDoingNothing;
         };
         bw.RunWorkerAsync();
     }
 }
Ejemplo n.º 2
0
        private void AddAutodiscoveryFolderButton_Click(object sender, EventArgs e)
        {
            string t = AddAutoDiscoveryTextBox.Text;

            if (string.IsNullOrWhiteSpace(t))
            {
                return;
            }
            if (!Directory.Exists(t))
            {
                MessageBox.Show("Directory does not exist");
                return;
            }
            LocalDataManager ldm = new LocalDataManager();
            Config           cfg = ldm.LoadConfig();

            cfg.GamesFolders.Add(t);
            GameAdder ga = new GameAdder();

            ga.DataReady += AdderOnDataReady;
            ga.AddGames(GameSuggestions.GetGameFolders(t));
            AddAutoDiscoveryTextBox.Text = "";
        }