Microsoft .NET provides Event-based Asynchronous Pattern (EAP), which offers multithreading capability without the need for a programmer to explicitly create or start a thread or task. Such classes are
WebClient. We'll focus on
BackgroundWorker later in detail. Now, we'll simply point out the features of
WebClient and will expand our factorial example to use an event instead of posting messages.
WebClient class, among others, provides methods for downloading data in synchronous and asynchronous execution. Our interest is in asynchronous methods. The code follows
[HostProtectionAttribute(SecurityAction::LinkDemand, ExternalThreading = true)] public: void DownloadDataAsync( Uri^ address ...