Events
-
Hello, System.Net.WebClient has method: DownloadDataAsync and event:DownloadDataCompleted How does it internally work? So...I assume when I call DownloadDataAsync it starts some private method StartDownload (for example) in a new thread, and from this StartDowload(which runs in the Thread) will be called DownloadDataCompleted(), BUT they have made it so, that in attached to the event method, i can use all UI, thats mean...that DownloadDataCompleted is called in the main programm thread, how did they did that? Thanks.
-
Hello, System.Net.WebClient has method: DownloadDataAsync and event:DownloadDataCompleted How does it internally work? So...I assume when I call DownloadDataAsync it starts some private method StartDownload (for example) in a new thread, and from this StartDowload(which runs in the Thread) will be called DownloadDataCompleted(), BUT they have made it so, that in attached to the event method, i can use all UI, thats mean...that DownloadDataCompleted is called in the main programm thread, how did they did that? Thanks.
Delegates.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
Delegates.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
Yes, but how? What should i invoke? So I mean, to invoke a UI control from Thread I should Invoke this control...but I want to be able OnEvent use all controls I want, without Invoking, like it did in System.Net.WebClient...is it possible? -- modified at 5:41 Wednesday 17th January, 2007
-
Hello, System.Net.WebClient has method: DownloadDataAsync and event:DownloadDataCompleted How does it internally work? So...I assume when I call DownloadDataAsync it starts some private method StartDownload (for example) in a new thread, and from this StartDowload(which runs in the Thread) will be called DownloadDataCompleted(), BUT they have made it so, that in attached to the event method, i can use all UI, thats mean...that DownloadDataCompleted is called in the main programm thread, how did they did that? Thanks.
Have a look at the new AsyncOperationManager[^] class introduced in .NET 2.0.
Regards Senthil [MVP - Visual C#] _____________________________ My Blog | My Articles | WinMacro
-
Have a look at the new AsyncOperationManager[^] class introduced in .NET 2.0.
Regards Senthil [MVP - Visual C#] _____________________________ My Blog | My Articles | WinMacro