private void OnDownloadManagerProgressChanged(object sender, DownloadManagerProgressChangedEventArgs e) { if (DownloadManagerProgressChanged != null) { DownloadManagerProgressChanged(sender, e); } }
static void dm_DownloadManagerProgressChanged(object sender, DownloadManagerProgressChangedEventArgs e) { if (!_dFilenames.ContainsKey(e.FileName)) { //The directory doesn't seem to be threadsafe. //So we'll just put it into the try-catch and ignore the exception try { _dFilenames.Add(e.FileName, e.PercentageCompleted); } catch (ArgumentException) { //Ignore - Will say there's a key already available } } else { _dFilenames[e.FileName] = e.PercentageCompleted; } DrawConsoleOutput(); }