private void ProcessTorrentsButton_Click(object sender, EventArgs e)
{
items = new List<FileInfo>();
torrents = DirectoryHandler.GetTorrents();
zips = DirectoryHandler.GetTorrentZips();
if (torrents != null || zips != null)
{
startime = DateTime.Now;
//Prevent anything complicated from happening..
dgvh.SuspendLayout();
ProcessTorrentsButton.Enabled = false;
RefreshButton.Enabled = false;
DeleteButton.Enabled = false;
StatusLabel.Visible = true;
dataGridViewProgressBar.Visible = true;
timer.Stop();
if (torrents != null)
foreach (string torrent in torrents)
items.Add(new FileInfo(torrent));
if (zips != null)
items.AddRange(dh.UnzipFiles(zips));
tb.RunWorkerAsync(items);
}
}