Using SevenZipSharp wrapper has anyone succeeded in aborting an in-progress compression? I used:
FileCompressionStarted(ByVal sender As Object, ByVal e As SevenZip.FileNameEventArgs)
to see some activity and tried:
e.cancel = true
but nothing happened. Compression continues working until all files are packed. Any ideas?
resolved and explained in other forum, please see link, thanks everyone
PS. Just to have solution here, in case anyone needs
e.cancel isn't treated well in library because (like I expected) when I set e.cancel = true once, the library may not catch this request. I'm not sure this is sevenzipsharp.dll problem or 7z.dll but in code posted, when many clicks hits to my Abort button, finally, library aborted compression !!!
So implementation needs to be:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
abort = True
Private Sub fFileCompressionStarted(ByVal sender As Object, ByVal e As SevenZip.FileNameEventArgs)
Dim s As String = ""
If abort Then
e.Cancel = True
s = " aborted"
console.addLine("[CompressionStarted event] e.Filename = " + e.FileName + ", e.PercentDone = " + e.PercentDone.ToString + s)
Public Sub fCompressionFinished(ByVal sender As Object, ByVal e As System.EventArgs)
abort = False
Edouard Gora, YO3HCV