private void TransferProgress(object sender, FileTransferProgressEventArgs e) { DarkFileDisplay dfd = FileDisplayList.Find(x => x.FileStructure.FileID == e.ID); if (dfd == null) { return; } if (mainForm.InvokeRequired) { mainForm.Invoke((MethodInvoker) delegate { dfd.UpdateProgress(e.PercentProgress); }); } }
private void Transferfinished(object sender, OutTransferEventArgs e) { DarkFileDisplay dfd = FileDisplayList.Find(x => x.FileStructure.FileID == e.FileID); if (dfd == null) { return; } if (mainForm.InvokeRequired) { mainForm.Invoke((MethodInvoker) delegate { dfd.TransferFinished(e); }); } if (FileDisplayList.Where(x => x.FileStructure.FileStatus == FileStatus.QueuedForDownload).Count() <= 0) { if (mainForm.InvokeRequired) { mainForm.Invoke((MethodInvoker) delegate { ChangeGuiState(GUIState.FilesSelected); }); } } }