Пример #1
0
        private async void SearchGames_Load(object sender, EventArgs e)
        {
            source = new BindingSource()
            {
                DataSource = Results
            };

            lst_results.AutoGenerateColumns = true;
            lst_results.DataSource          = source;

            if (Path != null)
            {
                Logger.Info("Searching {}", Path.FullName);
                await Task.Run(SearchDirectory(Path));
            }
            else if (Drives != null)
            {
                foreach (DriveInfo drive in Drives)
                {
                    Logger.Info("Searching drive {} ({})", drive.VolumeLabel, drive.Name);
                    Logger.Info(drive.RootDirectory.ToJSON());
                    await Task.Run(SearchDirectory(drive.RootDirectory));
                }
            }
            Logger.Info("Finished searching");
            Text            = $"Found {Results.Count} new games";
            lbl_status.Text = $"Finished searching, found {Results.Count} new games";
            Logger.Debug(Results.ToJSON(false));
            // lst_results.DataSource = source;
            lst_results.Columns["SourceMod"].ReadOnly = true;
        }