Difference between "ProgressChanged" and "ReportProgress"

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 :)
Fir5tSight [ Do, 03 Januar 2008 18:00 ] [ ID #1898593 ]

Re: Difference between "ProgressChanged" and "ReportProgress"

>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 [at] mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
mattias.dont.want.spa [ Fr, 04 Januar 2008 22:17 ] [ ID #1899483 ]
Microsoft » microsoft.public.dotnet.general » Difference between "ProgressChanged" and "ReportProgress"

Vorheriges Thema: Redirecting Assembly Versions
Nächstes Thema: Re: CallbackContract with inherited interfaces -> Base interface not seen in proxy code...