public class SaveProgressEventArgs : AsyncEventArgs
Shows how to handle the SaveProgress event.
using System; using ComponentPro.Compression; ... // Create a new instance. Zip zip = new Zip(); // Create a new zip file. zip.Create("test.zip"); // Add all files and subdirectories from 'c:\test' to the archive. zip.AddFiles(@"c:\test"); // Close the zip file. zip.Close(); // Reopen the ZIP file to modify zip = new Zip(); zip.Open("test.zip"); zip.SaveProgress += zip_SaveProgress; zip.Delete("*.cs", true); // Delete some files. This would cause the archive to preserve some files within the archive. zip.Close(); static void zip_SaveProgress(object sender, SaveProgressEventArgs e) string msg = null; switch (e.State) { case SaveProgressState.BackupArchive: msg = "Backing up archive..."; break; case SaveProgressState.PreserveFile: msg = "Preserving file " + e.FileName + "..."; break; case SaveProgressState.Rollback: msg = "Rolling back..."; break; case SaveProgressState.SaveArchive: msg = "Saving archive..."; break; } Console.WriteLine(msg + " " + e.Percentage + "%");