void AddProgress1(object sender, AddProgressEventArgs e) { switch (e.EventType) { case ZipProgressEventType.Adding_Started: TestContext.WriteLine("Adding_Started"); break; case ZipProgressEventType.Adding_Completed: TestContext.WriteLine("Adding_Completed"); break; case ZipProgressEventType.Adding_AfterAddEntry: TestContext.WriteLine("Adding_AfterAddEntry: {0}", e.CurrentEntry.FileName); break; } }
internal static AddProgressEventArgs Completed(string archiveName) { var x = new AddProgressEventArgs(archiveName, ZipProgressEventType.Adding_Completed); return x; }
void LNSF_AddProgress(object sender, AddProgressEventArgs e) { switch (e.EventType) { case ZipProgressEventType.Adding_Started: _txrx.Send("status Adding files to the zip..."); _pb1Set = false; break; case ZipProgressEventType.Adding_AfterAddEntry: if (!_pb1Set) { _txrx.Send(String.Format("pb 1 max {0}", _numEntriesToAdd)); _pb1Set = true; } if (!e.CurrentEntry.FileName.EndsWith("/")) { _numEntriesAdded++; if (_numEntriesAdded % 64 == 0) _txrx.Send(String.Format("status Adding file {0}/{1} :: {2}", _numEntriesAdded, _numEntriesToAdd, e.CurrentEntry.FileName)); _txrx.Send("pb 1 step"); } break; case ZipProgressEventType.Adding_Completed: _txrx.Send("status Added all files"); _pb1Set = false; _txrx.Send("pb 1 max 1"); _txrx.Send("pb 1 value 1"); break; } }
internal static AddProgressEventArgs AfterEntry(string archiveName, ZipEntry entry, int entriesTotal) { var x = new AddProgressEventArgs(archiveName, ZipProgressEventType.Adding_AfterAddEntry); x.EntriesTotal = entriesTotal; x.CurrentEntry = entry; return x; }
void AddProgress(object sender, AddProgressEventArgs e) { switch (e.EventType) { case ZipProgressEventType.Adding_AfterAddEntry: _progressEventCalls++; TestContext.WriteLine("{0}: {1}", e.EventType.ToString(), e.CurrentEntry.FileName); if (_cancelIndex == _progressEventCalls) { e.Cancel = true; TestContext.WriteLine("Cancelling..."); _wasCanceled = true; } break; } }