Difference between "ProgressChanged" and "ReportProgress"

Difference between "ProgressChanged" and "ReportProgress"

am 03.01.2008 18:00:11 von Fir5tSight

I use a background worker to process the data. Then updatge the UI
controls to display the latest info.

Someone told me to use a delegate "ProgressChanged" to launch an
update of the UI controls (from the background worker thread). But
someone else told me to use "ReportProgress" to launch an update of UI
controls (from the background worker thread).

What's the difference (or relation) between the two? Which one is
better? I get lost in the world of a thread pool :)

Re: Difference between "ProgressChanged" and "ReportProgress"

am 04.01.2008 22:17:15 von mattias.dont.want.spam

>I use a background worker to process the data. Then updatge the UI
>controls to display the latest info.
>
>Someone told me to use a delegate "ProgressChanged" to launch an
>update of the UI controls (from the background worker thread). But
>someone else told me to use "ReportProgress" to launch an update of UI
>controls (from the background worker thread).
>
>What's the difference (or relation) between the two? Which one is
>better? I get lost in the world of a thread pool :)

ReportProgress is the method that should be called by the worker
thread to report its progress.

ProgressChanged is an event that can be handled by code (likely on the
UI thread) that needs to be notified of progress changes.

When ReportProgress is called it will cause ProgressChanged to be
raised.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.