| C1.UWP.Zip Assembly > C1.C1Zip Namespace > C1ZipFile Class : Progress Event |
'Declaration Public Event Progress As ZipProgressEventHandler
public event ZipProgressEventHandler Progress
The event handler receives an argument of type ZipProgressEventArgs containing data related to this event. The following ZipProgressEventArgs properties provide information specific to this event.
| Property | Description |
|---|---|
| Cancel | Set to true to cancel the current operation. |
| FileLength | Gets the length of the file being compressed or expanded. |
| FileLengthLong | Gets the length of the file being compressed or expanded. |
| FileName | Gets the name of the file being compressed or expanded. |
| Position | Gets the current position into the stream. |
| PositionLong | Gets the current position into the stream. |
void Compress() { // create zip file C1Zip zip = new C1Zip(); zip.Create(zipFileName); // connect event handler zip.Progress += new ZipProgressEventHandler(zip_Progress); // add files foreach (string fileName in Directory.GetFiles(path, "*.*")) zip.Entries.Add(fileName); } // print messages while files are compressed void zip_Progress(object sender, ZipProgressEventArgs e) { Console.WriteLine("Compressing {0}, {1:p0} done", e.FileName, e.Position/(float)e.FileLength); }