private void ProcessTorrentsButton_Click(object sender, EventArgs e)
{
lock (lockingobject)
{
al = new ArrayList();
torrents = DirectoryHandler.GetTorrents();
zips = DirectoryHandler.GetTorrentZips();
if (torrents != null || zips != null)
{
if (torrents != null)
{
foreach (string torrent in torrents)
al.Add(torrent);
}
if (zips != null)
{
object[] rawFiles = DirectoryHandler.UnzipFiles(zips);
string[] ziptorrents = Array.ConvertAll<object, string>(rawFiles, Convert.ToString);
foreach (string ziptorrent in ziptorrents)
al.Add(ziptorrent);
}
timer.Stop();
dataGridViewProgressBar.Visible = true;
StatusLabel.Visible = true;
tb.RunWorkerAsync(al);
}
}
}