void zip1_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry || e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) { UpdateStatus("Extracting: " + e.CurrentEntry.FileName + " [" + MathFunctions.CalculatePercent(e.BytesTransferred, e.TotalBytesToTransfer) + "% complete]"); } }
private static void HandleZipExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) { _entriesExtracted++; } else if (e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) { double percent = _entriesExtracted / (0.01 * _entriesTotal); double entrypercent = e.BytesTransferred / (0.01 * e.TotalBytesToTransfer); string entry = string.Format("{0:00}%", entrypercent); string spaces = ""; for (int i = 0; i <= 4 - entry.Length; i++) { spaces += " "; } if (_mod.SimpleProgress) { Console.Write("{0:00}%)\r", percent); } else { Console.Write("{0}{1}({2:00}%)\r", entry, spaces, percent); } } }
private void Zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { // tpb.CustomText = "Extraindo"; if (e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) { if (e.BytesTransferred == e.TotalBytesToTransfer) { //tpb.Value = (int)(iZip++ / (0.01 * totalZip)); //updateProgressBar(tpb, (int)(iZip++ / (0.01 * totalZip))); qtdZip = (int)(iZip++ / (0.01 * totalZip)); } //tpb.Value = (int)(e.BytesTransferred / (0.01 * e.TotalBytesToTransfer)); } if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractAll) { updateProgressBar(tpb, qtdZip, "Extraindo arquivo."); //tpb.CustomText = "Extraindo arquivo."; } if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) { //tpb.CustomText = $"Extraindo arquivo: {e.CurrentEntry.FileName}"; //tpb.CustomText = $"Extraindo arquivos {e.CurrentEntry.FileName} - ({iZip}/{totalZip})"; updateProgressBar(tpb, qtdZip, $"Extraindo arquivos {e.CurrentEntry.FileName} - ({iZip}/{totalZip})"); totalZip = e.EntriesTotal; } //tpb.Value = (int)(1.0d / e.TotalBytesToTransfer * e.BytesTransferred * 100.0d); }
void zip_Progress(object sender, ExtractProgressEventArgs e) { string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), @"TheLongDrive\Mods"); downloadperc.Text = "Unzipping... " + e.EntriesTotal + "B/" + e.TotalBytesToTransfer + "B"; }
void zipFile_ExtractProgress(object sender, ExtractProgressEventArgs e) { switch (e.EventType) { case ZipProgressEventType.Extracting_EntryBytesWritten: { EventHandler <ExtractProgressChangedEventArgs> handler = CurrentFileExtractProgressChanged; if (handler != null) { handler(this, new ExtractProgressChangedEventArgs(e.BytesTransferred, e.TotalBytesToTransfer)); } } break; case ZipProgressEventType.Extracting_AfterExtractEntry: { EventHandler <EventArgs> handler = CurrentFileExtractCompleted; if (handler != null) { handler(this, e); } } break; } }
/// <summary> /// ProgressBar for the decryption /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void extractProgress(object sender, ExtractProgressEventArgs e) { if (e.TotalBytesToTransfer > 0) { progressBarEncryption1.Value = (int)((e.BytesTransferred * 100) / e.TotalBytesToTransfer); } }
void zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_AfterExtractAll) { OnDescompresionFinalizada(); } }
static void zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_AfterExtractEntry) { progress = (float)e.EntriesExtracted / (float)e.EntriesTotal; } }
void zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { switch (e.EventType) { case ZipProgressEventType.Extracting_AfterExtractEntry: if (context != null) { context.Send( (o) => { Text.Txt = string.Format( "Unpacking {0} from {1}", e.EntriesExtracted, e.EntriesTotal ); if (e.EntriesExtracted == e.EntriesTotal) { Environment.Exit(0); } }, null ); } break; } }
private void extract_zipfile_progress(object sender, ExtractProgressEventArgs e) { // Console.WriteLine(e.EventType); Application.Current.Dispatcher.Invoke(() => { int total = e.EntriesTotal; int treated = e.EntriesExtracted; switch (e.EventType) { case ZipProgressEventType.Extracting_BeforeExtractAll: prgbDownload.Value = 0; break; case ZipProgressEventType.Extracting_AfterExtractEntry: prgbDownload.Maximum = total; prgbDownload.Value = treated; prgbDownloadText.Text = "Extracting..." + string.Format("{0:N0} / {1:N0}", treated, total); break; case ZipProgressEventType.Extracting_AfterExtractAll: prgbDownloadText.Text = "Completed"; break; default: break; } }); }
private static void z_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EntriesExtracted == e.EntriesTotal) { _extractThemeResult = ThemeInstallingResult.SUCCESS; } }
private void zipFile_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) { try { // Placeholder for when I add the cancellation logic yoooooooo. CancellationToken.None.ThrowIfCancellationRequested(); } catch { e.Cancel = true; throw; } Log.Info("Extracting {0}", e.CurrentEntry.FileName); _patcherContext.UpdateMainProgress(string.Format("Extracting {0}", e.CurrentEntry.FileName), isProgressbarVisible: true, isIndeterminate: true); } else { if (e.EventType != ZipProgressEventType.Extracting_AfterExtractEntry) { return; } _patcherContext.UpdateMainProgress(string.Format("Extracting {0}", e.CurrentEntry.FileName), progress: e.EntriesExtracted / (double)e.EntriesTotal * 100.0, isProgressbarVisible: true, isIndeterminate: true); } }
public void ExtractProgressChanged(object sender, ExtractProgressEventArgs e) { try { if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractAll) { startInstall.Text = "Extracting"; tableLayoutPanel1.Cursor = System.Windows.Forms.Cursors.WaitCursor; } else if (e.EventType == ZipProgressEventType.Extracting_AfterExtractAll) { tableLayoutPanel1.Cursor = System.Windows.Forms.Cursors.Default; startInstall.Text = "Completed"; allowClose = true; } if (e.EntriesExtracted != 0) { instDetails.Text = "Extracting: " + (e.EntriesExtracted) + "/" + e.EntriesTotal; instProgress.Maximum = e.EntriesTotal; instProgress.Value = e.EntriesExtracted; int perc = (int)((e.EntriesExtracted * 100) / e.EntriesTotal); dnPerc.Text = perc.ToString() + "%"; } } catch (Exception ex) { //instDetails.Text = ex.Message; } }
internal static ExtractProgressEventArgs ExtractAllCompleted(string archiveName, string extractLocation) { ExtractProgressEventArgs extractProgressEventArgs = new ExtractProgressEventArgs(archiveName, ZipProgressEventType.Extracting_AfterExtractAll); extractProgressEventArgs._target = extractLocation; return(extractProgressEventArgs); }
private static void File_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EntriesExtracted > 0) { Console.Write((e.ArchiveName + ": " + e.EntriesExtracted + " / " + e.EntriesTotal).PadRight(40) + "\r"); } }
void zf_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_AfterExtractAll) { this.BeginInvoke(new MethodInvoker(Finish)); } }
private void zip1_ExtractProgressIconic(object sender, ExtractProgressEventArgs e) { if (e.EntriesExtracted > 0) { if (bCancel) { e.Cancel = true; } try { progDecompress.Value = (int)((1000 * e.EntriesExtracted) / e.EntriesTotal); totalFiles = e.EntriesTotal; lbDecompressPercent.Text = (progDecompress.Value / 10).ToString() + "%"; } catch { } Application.DoEvents(); } if (e.EventType == ZipProgressEventType.Error_Saving) { bError = true; progDecompress.Value = 0; statDecompress.BackColor = Color.Red; statDecompress.Text = "Failed!"; MessageBox.Show("Failed to decompress", "Failed to decompress archive\n\n" + e.ArchiveName, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
void zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.TotalBytesToTransfer > 0) { progressBar1.Value = Convert.ToInt32(100 * e.BytesTransferred / e.TotalBytesToTransfer); } }
private void DecompressionProgres(object sender, ExtractProgressEventArgs e) { try { if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) { int temp = 0; this.mCabFileSize += e.CurrentEntry.CompressedSize; if (this.mCabFileSize != 0) { temp = Convert.ToInt32(70 * ((double)this.mCabFileSize / this.mCabFileSize)); } if (temp >= 70) { temp = 70; } this.mProcess.RefreshProgressBar(e.CurrentEntry.FileName, temp); } } catch (Exception ex) { } }
private void _epfArchive_ExtractProgress(object sender, ExtractProgressEventArgs e) { switch (e.EventType) { case ExtractProgressEventType.ExtractionStarted: Status.Log.Info("Extraction started."); Status.Progress.Value = 0; Status.Progress.Visible = true; Locked = true; break; case ExtractProgressEventType.ExtractionBeforeReadEntry: Status.Log.Info($"Extracting Entry [{e.EntriesExtracted} of {e.EntriesTotal}] {e.CurrentEntry.Name}..."); break; case ExtractProgressEventType.ExtractionAfterReadEntry: Status.Progress.Value = (int)(((double)e.EntriesExtracted / (double)e.EntriesTotal) * 100.0); break; case ExtractProgressEventType.ExtractionCompleted: Status.Log.Success("Extraction from archive completed."); Locked = false; Status.Progress.Visible = false; break; case ExtractProgressEventType.ExtractionEntryBytesWrite: break; default: break; } }
public void zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) { filesExtracted++; progressBar1.Value = 100 * filesExtracted / totalFiles; } }
private void Unzip_ExtractProgressChanged(object sender, ExtractProgressEventArgs e) { if (e.TotalBytesToTransfer != 0) { Bar1SetProgress(e.BytesTransferred, e.TotalBytesToTransfer); Arquivo_Bar.Update(); } }
private void z_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EntriesExtracted == e.EntriesTotal) { picStatus.Image = igcmd.Properties.Resources.ok; lblStatus.Text = "Install successful!"; } }
private void ComponentExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.TotalBytesToTransfer > 0) { long percent = e.BytesTransferred * 100 / e.TotalBytesToTransfer; _extractWorker.ReportProgress((int)percent); } }
public void ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) { this.setStatusText(String.Format("{0} Extracting: {1}", this.currentFileProcessing(), e.CurrentEntry.FileName)); this.setProgressbar(percentComplete); } }
private void Zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { DownloadStatus.Text = "Extracting files " + e.EntriesExtracted + "/" + e.EntriesTotal; if (e.TotalBytesToTransfer > 0) { ProgressBar.Value = Convert.ToInt32(100 * e.BytesTransferred / e.TotalBytesToTransfer); } }
void zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.TotalBytesToTransfer > 0) { progressBar1.Value = Convert.ToInt32(100 * e.BytesTransferred / e.TotalBytesToTransfer); label1.Text = "Status: Files extracted " + e.CurrentEntry.ToString(); } }
private void zip_ExtractProgress(object sender, ExtractProgressEventArgs e) { /* * Extracting_BeforeExtractEntry = 17, * Extracting_AfterExtractEntry = 18, * Extracting_ExtractEntryWouldOverwrite = 19, * Extracting_EntryBytesWritten = 20, * Extracting_BeforeExtractAll = 21, * Extracting_AfterExtractAll = 22, * * if (e.EntriesTotal <= 0) return; * progressBar2.Maximum = e.EntriesTotal; * progressBar2.Value = e.EntriesExtracted; */ if (cancelDecrypt == true) { e.Cancel = true; return; } Application.DoEvents(); if (e.EventType == ZipProgressEventType.Adding_Started) { MessageBox.Show("adding started"); } else if (e.EventType == ZipProgressEventType.Adding_AfterAddEntry) { MessageBox.Show("Adding_AfterAddEntry:" + e.EntriesTotal.ToString()); } else if (e.EventType == ZipProgressEventType.Adding_Completed) { MessageBox.Show("Adding_Completed:" + e.EntriesTotal.ToString()); } else if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractAll) { decpypt_status.Text = "开始解密..."; } else if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry) { decpypt_status.Text = "正在解密[%0]: " + e.CurrentEntry.FileName; progressBar2.Maximum = e.EntriesTotal; progressBar2.Value = e.EntriesExtracted + 1; } else if (e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) { int progress = (int)((e.BytesTransferred * 100) / e.TotalBytesToTransfer); decpypt_status.Text = "正在解密[" + progress.ToString() + "%]: " + e.CurrentEntry.FileName; } else if (e.EventType == ZipProgressEventType.Extracting_AfterExtractAll) { // MessageBox.Show("Done: " + e.ArchiveName); decpypt_status.Text = "解密完成..."; } else if (e.EventType == ZipProgressEventType.Saving_AfterCompileSelfExtractor) { MessageBox.Show("Saving_AfterCompileSelfExtractor: " + e.ArchiveName); } }
private void Action_ZipProgress(object sender, ExtractProgressEventArgs e) { if (e.TotalBytesToTransfer != 0) { int percentage = Convert.ToInt32(e.BytesTransferred / e.TotalBytesToTransfer * 100); Worker.ReportProgress(0, "Unzipping... | " + percentage + " %"); Worker.ReportProgress(0, "[PROGRESSBAR] " + (updater_zipCount * 100) + ";" + (updater_zipCurrentCount * 100 + percentage)); } }
private void ArchiveZ_ExtractProgress(object sender, ExtractProgressEventArgs e) { CancelFlag = e.Cancel; // Debug.WriteLine($"{e.ArchiveName}, {e.CurrentEntry.FileName}, {e.EntriesExtracted}/{e.EntriesTotal}"); // On peut placer le cancel token ici if (CancelToken.IsCancellationRequested) { e.Cancel = true; IsInterrupted = true; } #region Event Type switch (e.EventType) { case ZipProgressEventType.Extracting_BeforeExtractAll: Debug.WriteLine("BeforeExtractAll"); break; // #1 - on a le nom du fichier case ZipProgressEventType.Extracting_BeforeExtractEntry: Timer.Restart(); Debug.WriteLine("BeforeExtractEntry"); this.UpdateProgress?.Invoke(this, new ProgressArg(0, 100, e.Cancel)); this.UpdateStatus?.Invoke(this, new StateArg($"Begin extraction: {e.CurrentEntry.FileName}", CancelFlag)); break; // #2 - on a les bytes transferés, la somme totale a transférer, le nom du ficiher case ZipProgressEventType.Extracting_EntryBytesWritten: if (Timer.ElapsedMilliseconds < TimeLimit) { return; } Debug.WriteLine($"EntryBytesWritten: {e.BytesTransferred}|{e.TotalBytesToTransfer}"); double percent = Math.Round((Double)e.BytesTransferred * 100 / e.TotalBytesToTransfer); this.UpdateProgress?.Invoke(this, new ProgressArg(percent, e.TotalBytesToTransfer, CancelFlag)); break; // Apparu à la fin d'un fichier - on a le nom du fichier case ZipProgressEventType.Extracting_AfterExtractEntry: Timer.Stop(); Debug.WriteLine("AfterExtractEntry"); this.UpdateProgress?.Invoke(this, new ProgressArg(100, 100, CancelFlag)); this.UpdateStatus?.Invoke(this, new StateArg($"Extraction finished: {e.CurrentEntry.FileName}", CancelFlag)); break; case ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite: Debug.WriteLine("ExtractEntryWouldOverwrit"); break; case ZipProgressEventType.Extracting_AfterExtractAll: break; } ; #endregion }
void ExtractProgress(object sender, ExtractProgressEventArgs e) { switch (e.EventType) { case ZipProgressEventType.Extracting_BeforeExtractEntry: if (!_pb1Set) { _txrx.Send(String.Format("pb 1 max {0}", _numFilesToExtract)); _pb1Set = true; } _pb2Set = false; _nCycles = 0; break; case ZipProgressEventType.Extracting_EntryBytesWritten: if (!_pb2Set) { _txrx.Send(String.Format("pb 2 max {0}", e.TotalBytesToTransfer)); _pb2Set = true; } // for performance, don't update the progress monitor every time. _nCycles++; if (_nCycles % 64 == 0) { _txrx.Send(String.Format("status Extracting entry {0}/{1} :: {2} :: {3}/{4}mb :: {5:N0}%", _numExtracted, _numFilesToExtract, e.CurrentEntry.FileName, e.BytesTransferred/(1024*1024), e.TotalBytesToTransfer/(1024*1024), ((double)e.BytesTransferred) / (0.01 * e.TotalBytesToTransfer) )); string msg = String.Format("pb 2 value {0}", e.BytesTransferred); _txrx.Send(msg); } break; case ZipProgressEventType.Extracting_AfterExtractEntry: _numExtracted++; _txrx.Send("pb 1 step"); break; } }
private void OverwriteDecider(object sender, ExtractProgressEventArgs e) { switch (e.EventType) { case ZipProgressEventType.Extracting_ExtractEntryWouldOverwrite: // randomly choose whether to overwrite or not e.CurrentEntry.ExtractExistingFile = (_rnd.Next(2) == 0) ? ExtractExistingFileAction.DoNotOverwrite : ExtractExistingFileAction.OverwriteSilently; break; } }
void zip1_ExtractProgress(object sender, ExtractProgressEventArgs e) { if (e.EventType == ZipProgressEventType.Extracting_BeforeExtractEntry || e.EventType == ZipProgressEventType.Extracting_EntryBytesWritten) { UpdateStatus("Extracting: " + e.CurrentEntry.FileName + " [" + MathFunctions.CalculatePercent(e.BytesTransferred, e.TotalBytesToTransfer) + "% complete]"); } }