C#C
C#3y ago
stigzler

❔ ✅ Baffled by Async-Await and Task

I'm trying to create a non-UI blocking Unzipper helper class that reports progress. I've tried to take on async/await + tasks so many times, but always come a cropper. I can manage Async/await with .net async methods (e.g. webClient.DownloadFileAsync, but the problem comes with sychronous key methods. Anyways, here's the helper class:

https://paste.mod.gg/xklfwuocvtgm/0

and it's called, thus:

 string targetDir = "C:\\temp\\project tests\\Updater\\NetUpdate\\App";
Unzipper unzipper = new Unzipper(new FileInfo(tempPayloadFile), new DirectoryInfo(targetDir));
unzipper.NewEntryExtractionStarted += Unzip_NewEntryExtractionStarted;
unzipper.EntryExtractionProgressed += Unzip_EntryExtractionProgressed;
unzipper.Unzip();


I've done no end of reading - just conceptually this is illuding me. What am I missing - based on this code?
A tool for sharing your source code with the world!
Was this page helpful?