PowerTCP Zip Compression for .NET
EndUnzip Event
Example 




Occurs when an asynchronous Unzip operation completes
Syntax
<CategoryAttribute("Completion")>
<DescriptionAttribute("Raised when a BeginUnzip operation completes.")>
Public Event EndUnzip As EndEventHandler
Dim instance As Archive
Dim handler As EndEventHandler
 
AddHandler instance.EndUnzip, handler
[Category("Completion")]
[Description("Raised when a BeginUnzip operation completes.")]
public event EndEventHandler EndUnzip
[Category("Completion")]
[Description("Raised when a BeginUnzip operation completes.")]
public: __event EndEventHandler* EndUnzip
[Category("Completion")]
[Description("Raised when a BeginUnzip operation completes.")]
public:
event EndEventHandler^ EndUnzip
Event Data

The event handler receives an argument of type EndEventArgs containing data related to this event. The following EndEventArgs properties provide information specific to this event.

PropertyDescription
Exception Gets the Exception that occurred.  
State Returns any state information included with this event.  
Remarks
if an error occurs during the unzip operation, EndEventArgs.Exception can be checked for the exception.
Example
The following example demonstrates loading a compressed file and asynchronously unzipping the contents.
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Zip"
' at the top of your class.

' Open a compressed stream.  This populates the Archive collection.
Archive1.Open("c:\test.zip")

' Preserve the path structure and overwrite any existing files.
Archive1.PreservePath = True
Archive1.Overwrite = Overwrite.Always

' Begin an asynchronous unzip process
Archive1.BeginUnzip("c:\test", Nothing)

Private Sub Archive1_EndUnzip(ByVal sender As Object, ByVal e As Dart.PowerTCP.Zip.EndEventArgs) Handles Archive1.EndUnzip
    Try
        ' Check for any zip operation exceptions
        If e.Exception Is Nothing Then
            MessageBox.Show("Extraction Complete!")
        Else
            MessageBox.Show(e.Exception.Message)
        End If

    Catch

    End Try
End Sub
// Be sure to import the namespace by putting "using Dart.PowerTCP.Zip;"
// at the top of your class.

// Open a compressed stream.  This populates the Archive collection.
archive1.Open("c:\\test.zip");

// Preserve the path structure and overwrite any existing files.
archive1.PreservePath = true;
archive1.Overwrite = Overwrite.Always;

// Begin an asynchronous unzip process
archive1.BeginUnzip("c:\\test",null);

private void archive1_EndUnzip(object sender, Dart.PowerTCP.Zip.EndEventArgs e)
{
	try
	{
		if (e.Exception == null)
			MessageBox.Show("Extraction Complete!");
		else
			MessageBox.Show(e.Exception.Message);
	}
	catch {}

}
See Also

Reference

Archive Class
Archive Members


PowerTCP Zip for .NET Documentation Version 2.1.1
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic