The GatheringZipContentByteProgression event is raised during the step preceding the actual creation of the target zip file, where files to keep from the original zip file (the ones that were not modified) are gathered to a temporary location before overwriting the zip file.
This event will only be raised when updating or modifying and existing zip file.
Purpose
The purpose of the GatheringZipContentByteProgression event is to provide progress information during the process of gathering the non-modified files from the original zip file so that applications do not appear to be idle.
Basic steps - C#
To subscribe to the GatheringZipContentByteProgression event, the following steps must be performed:
-
Create a reference to a ZipEvents object.
-
Subscribe to the GatheringZipContentByteProgression event of the ZipEvents object using the GatheringZipContentByteProgressionEventHandler 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 OnGatheringZipContentByteProgression.
-
Place the desired code in the newly created event handler.
Basic steps - VB.NET
To subscribe to the GatheringZipContentByteProgression event, the following steps must be performed:
-
Create a reference to a ZipEvents object using the WithEvents keyword.
-
Select the GatheringZipContentByteProgression 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 add a new file to an existing zip file and retrieve progress information during the gathering phase.
VB.NET | Copy Code |
---|---|
|
C# | Copy Code |
---|---|
|