Example #1
0
        private void zipProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
        {
            if (_mapUpdateWorker.CancellationPending)
            {
                e.Cancel = true;
                return;
            }

            if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_EntryBytesRead)
            {
                int value       = Convert.ToInt32(100 * e.BytesTransferred / e.TotalBytesToTransfer);
                int total_value = Convert.ToInt32(100 * (e.BytesTransferred + _currentFileSize) / _totalFileSize);

                CommonUtil.SetLabelText(this, updateProgressLabel, string.Format("{0}  %", (int)value));
                CommonUtil.SetProgressBarValue(progressBar, (int)value);

                CommonUtil.SetLabelText(this, updateTotalProgressLabel, string.Format("{0}  %", (int)total_value));
                CommonUtil.SetProgressBarValue(totalProgressBar, (int)total_value);
            }
            else if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_Completed)
            {
            }
            else if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_AfterWriteEntry)
            {
                _currentFileSize += e.CurrentEntry.UncompressedSize;
            }
        }
Example #2
0
 private void Zip_SaveFileProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
 {
     if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_BeforeWriteEntry)
     {
         WinForms.MessageBox.Show("Succsess", "Info", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
     }
 }
Example #3
0
 private void Zip_SaveProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
 {
     if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_BeforeWriteEntry)
     {
         progressBar.Invoke(new MethodInvoker(delegate
         {
             progressBar.Maximum = e.EntriesTotal;
             progressBar.Value   = e.EntriesSaved + 1;
         }));
     }
 }
Example #4
0
 private void Zip_SaveFileProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
 {
     if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_EntryBytesRead)
     {
         progressBar.Invoke(new MethodInvoker(delegate
         {
             progressBar.Maximum = 100;
             progressBar.Value   = (int)((e.BytesTransferred * 100) / e.TotalBytesToTransfer);
             progressBar.Update();
         }));
     }
 }
Example #5
0
 private void Zip_SaveFileProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
 {
     if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_EntryBytesRead)
     {
         progressBar.Invoke(new MethodInvoker(delegate
         {
             progressBar.Maximum = 100;
             progressBar.Value   = (int)((e.BytesTransferred * 100) / e.TotalBytesToTransfer);
             progressBar.Update();
             label3.Text = progressBar.Value.ToString();
             if (progressBar.Value == progressBar.Maximum)
             {
                 MessageBox.Show("Completed");
             }
         }));
     }
 }
Example #6
0
 private void Zip_SaveProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
 {
     if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_BeforeWriteEntry)
     {
         progressBar.Invoke(new MethodInvoker(delegate
         {
             progressBar.Maximum = e.EntriesTotal;
             progressBar.Value   = e.EntriesSaved + 1;
             progressBar.Update();
             label3.Text = progressBar.Value.ToString();
             if (progressBar.Value == progressBar.Maximum)
             {
                 MessageBox.Show("Completed");
             }
         }));
     }
 }
Example #7
0
        private void Zip_SaveFileProgress(object sender, Ionic.Zip.SaveProgressEventArgs e)
        {
            if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_Started)
            {
                txtLog.Invoke(new MethodInvoker(delegate
                {
                    txtLog.Text += string.Format("\r\n {0}{1}", "Tworzenie archiwum: ", e.ArchiveName);
                    txtLog.Update();
                }));
            }
            else if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_BeforeWriteEntry)
            {
                txtLog.Invoke(new MethodInvoker(delegate
                {
                    txtLog.Text += "\r\n Zapis do archiwum: " + e.CurrentEntry.FileName + " (" + (e.EntriesSaved + 1) + "/" + e.EntriesTotal + ")";
                    txtLog.Text += string.Format("\r\n {0}{1}", "Nazwa pliku: ", e.CurrentEntry.FileName);
                    txtLog.Update();
                }));

                progressBar.Invoke(new MethodInvoker(delegate
                {
                    progressBar.Maximum = e.EntriesTotal;
                    progressBar.Value   = (int)e.EntriesSaved + 1;
                    progressBar.Update();
                }));
            }
            else if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_EntryBytesRead)
            {
                progressBar.Invoke(new MethodInvoker(delegate
                {
                    progressBar.Maximum = 100;
                    progressBar.Value   = (int)((e.BytesTransferred * 100) / e.TotalBytesToTransfer);
                    progressBar.Update();
                }));
            }
            else if (e.EventType == Ionic.Zip.ZipProgressEventType.Saving_Completed)
            {
                txtLog.Invoke(new MethodInvoker(delegate
                {
                    txtLog.Text += string.Format("\r\n {0}{1}", "Koniec: ", e.ArchiveName);
                    txtLog.Update();
                }));
            }
        }