Exemple #1
0
        private void OnFileDownloadPorgress(object sender, TransferProgressEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke((Action) delegate { OnFileDownloadPorgress(sender, e); }, null);
                return;
            }
            //Console.WriteLine(string.Format("file Download progress: {0} {1} {2}/{3}", e.File, e.Progress, e.BytesSent, e.TotalLength));

            var item = listViewDownload.Items.Find(e.Key, false);

            if (item.Length > 0)
            {
                item[0].SubItems[3].Text = string.Format("{0:P}", e.Progress);// e.Progress.ToString();
            }
        }
Exemple #2
0
        private void OnFileUploadPorgress(object sender, TransferProgressEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.Invoke((Action)delegate { OnFileUploadPorgress(sender, e); }, null);
                return;
            }
            //Console.WriteLine(string.Format("file upload progress: {0} {1} {2}/{3}", e.File, e.Progress, e.BytesSent, e.TotalLength));

            var item = listViewUpload.Items.Find(e.Key, false);
            if (item.Length > 0)
            {
                item[0].SubItems[3].Text = string.Format("{0:P}", e.Progress);// e.Progress.ToString();
            }
        }