From the course: Asynchronous Programming in C#
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Reporting task progress - C# Tutorial
From the course: Asynchronous Programming in C#
Reporting task progress
- [Instructor] Even though you may asynchronously execute long running tasks, leaving your users free to do other things in your app, they may still like to see how the long running task is progressing. The .net framework provides an interface specifically designed to help you do that. The Iprogress of T interface contains a single method named report. To use it, you pass an object that implements the interface to your asynchronous method. Inside the method, you call report when you want to communicate a progress update back to the calling code. The T, generic type parameter, represents the type that contains the progress data passed back to the caller. It can be a simple built-in type like a string or integer or a custom type you've created to store precisely what you want the caller to know about the task progress. You're free to create your own custom implementation of the IProgress interface, but there's one already…