Exemplo n.º 1
0
        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); });
            }
        }
Exemplo n.º 2
0
        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); });
                }
            }
        }