The BuildingZipItemProgression event is raised each time a temporary file is about to be added to the target zip file.
Keep in mind that using the BuildingZipItemProgression event increases the time it takes to process the temporary files. The reason behind this is that the data will be scanned twice. The first time the files are scanned, information regarding the files will be accumulated ( filename, size, etc.. ). This is to allow accurate progress information to be returned during the second run.
Purpose
The main purpose of the BuildingZipItemProgression event is to provide feedback to the user during the process of moving the temporary files to the temporary zip file to prevent the application from appearing frozen.
Basic steps - C#
To subscribe to the BuildingZipItemProgression event, the following steps must be performed:
-
Create a reference to a ZipEvents object.
-
Subscribe to the BuildingZipItemProgression event of the ZipEvents object using the BuildingZipItemProgressionEventHandler delegate class.
-
Create a new method that will handle the events that are raised. For the purposes of this example, we will call the method OnBuildingZipItemProgression.
-
Place the desired code in the newly created event handler.
Basic steps - VB.NET
To subscribe to the BuildingZipItemProgression event, the following steps must be performed:
-
Create a reference to a ZipEvents object using the WithEvents keyword.
-
Select the BuildingZipItemProgression event from the list of available methods in the newly instantiated ZipEvents object. This is done in the same manner as, for example, adding the DoubleClick event of a ListBox.
You can also subscribe to the event using the AddHandler/AddressOf statement. -
Place the desired code in the newly added event handler.
Demonstration
This example demonstrates how to delete a folder from within a zip file and display progress information during the operation.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
using Xceed.Zip; |