Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More VFP nostalgia : wait nowait
Message
De
10/10/2011 09:40:09
 
 
À
10/10/2011 09:25:17
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Divers
Thread ID:
01525944
Message ID:
01525965
Vues:
60
I've got the CTP but I'm not sure that it is (or would be) the best approach in this situation since, unless I've missed something, there's no way to communicate progress. Also the async method doesn't actually run in another thread so in some ways would be less efficient.....

>This is exactly what the new Asynch stuff is designed for and makes it lots easier. In C# it's implemented with the Asynch/Await commands. But the version of .Net that supports that is not in production yet.
>
>>It's pretty straightforward.
>>(a) Create a BackgroundWorker Instance.
>>(b) Wire it up so that when RunWorkerAsync is called it runs whatever code should be executed in the backgound in bgw_DoWork.
>>(c) Set the WorkerReportsProgress true
>>(d) Wire up the bgw_ProgressChanged method so that it is called when .ReportProgress is raised in the bgw_DoWork.
>>(e) Update the progress bar (or do something else) in the bgw_ProgressChanged callback.
>>
>>If you want to perform some other action when the worker completes then wire up the RunWorkerCompleted event as well.
>>
>>The example below is self-contained and debugging that with breakpoints should make it easy to understand what's going on.
>>(Don't forget there's a pretty good C# => VB.NET converter at http://www.developerfusion.com/tools/convert/csharp-to-vb/ )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform