Welcome Guest Search | Active Topics | Members | Log In | Register

Difference between "ProgressChanged" and "ReportProgress" Options · View
Curious
Posted: Thursday, January 03, 2008 1:00:11 AM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 03/01/2008 01:00:11
Date: Thu, 3 Jan 2008 09:00:11 -0800 (PST)

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 :)
Mattias Sjögren
Posted: Friday, January 04, 2008 11:17:15 PM


Rank: Guest
Groups: Guest

Joined: 9/17/2007
Posts: 11,670
Points: -1,200
Date parsed: 04/01/2008 23:17:15
Date: Fri, 04 Jan 2008 22:17:15 +0100

>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.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.1 (NET v2.0) - 9/10/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.038 seconds.