The ReadingZipItemProgression event is raised whenever an item in a zipped folder is about to be read.
Purpose
When reading the central directory of large zip file, your application can appear to be frozen. The ReadingZipItemProgression event allows you to provide feedback to your user during this possibly lengthy operation.
Basic steps - C#
To subscribe to the ReadingZipItemProgression event, the following steps must be performed:
-
Create a reference to a ZipEvents object.
-
Subscribe to the ReadingZipItemProgression event of the ZipEvents object using the ReadingZipItemProgressionEventHandler 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 OnReadingZipItemProgression.
-
Place the desired code in the newly created event handler.
Basic steps - VB.NET
To subscribe to the ReadingZipItemProgression event, the following steps must be performed:
-
Create a reference to a ZipEvents object using the WithEvents keyword.
-
Select the ReadingZipItemProgression 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 contained within a zip file and display progress information while each item in the zip file is being read.
VB.NET | Copy Code |
---|---|
Dim WithEvents zEvents As New ZipEvents() folder.Delete( zEvents, Nothing ) Private Sub zEvents_ReadingZipItemProgression( ByVal sender As Object, _ |
C# | Copy Code |
---|---|
|