Need Simple Async/Await Progress Bar Example
I've found multiple examples of using Async/Await, but they are either using web page downloading or file downloading as the asynchronous or blocking method being called. In the examples the progress bar is then called and updated for each string (or object returned) from the web page or complete file returned. I am trying to call a method that takes ~5 seconds to execute and while this is occurring, be separately updating a progress bar on ~0.5 second intervals. Can anyone steer me in the direction where I could find a similar example?
Re: Need Simple Async/Await Progress Bar Example
You should use multi threading for this instead. Just use a thread pool instead.
Re: Need Simple Async/Await Progress Bar Example
Thank you for the suggestion. I had first considered using a separate thread or helper function, but subsequent research recommended against either option and using the Async approach instead. It was considered less problematic, less complicated and well suited this scenario. I'm hoping to keep the solution simpler as it doesn't warrant complexity -- it's a nicety for the user, but this isn't a commercial application.
Re: Need Simple Async/Await Progress Bar Example
Hello,
Look at the first link in my signature for an example that uses Async/await includes a progress bar. All the work is done in a class project called from a Forms project.
Re: Need Simple Async/Await Progress Bar Example
Hi Kevininstructor,
Thank you for responding to my problem. The example referred to that came the closest, that I found using a progress label, was Asynchronous demos for read/write files using Async and Await for VS2012 or high. This example was in the Asynchronous demos for read/write files.... Just wanted to confirm that was what you meant so I don't off on a wild goose chase.
Re: Need Simple Async/Await Progress Bar Example
Both projects would be good to learn from and for the record both were done as there are not many decent examples other than the web downloads as you have found out.
Re: Need Simple Async/Await Progress Bar Example
Great! Thanks for the help, I'll dive in to them.