I am having a C# application to sync data between PC and palm devices.
There are codes written like below:
showMessage("synchronizing Table1");
Sync(destTable1,sourceTable1);
Sync(destTable2,sourceTable2);
showMessage("synchronizing Table2");
// more code
How do I separate the actual process of synchronizing from displaying message?
Which design pattern to follow?
Thanks in advance…
You should run the sync process on a separate thread and inform the main thread of the progress. The main thread displays messages.
You can obtain this behavior using the BackgroundWorker class that has all the feature ready.