public static void AddDownloads(int[] epids) { lock (downloads) { foreach (int epid in epids) { DownloadHandler download = new DownloadHandler(epid); downloads.Add(epid, download); downloadQueue.Enqueue(epid); download.Progress += DownloadHandler_Progress; download.Finished += DownloadHandler_Finished; } } StartNextDownload(); }