EAPs are used to create components that wrap expensive and time-consuming operations. Due to this, they need to be made asynchronous. This pattern has been used in the .NET Framework to create components such as BackgroundWorker and WebClient.
Methods that implement this pattern carry out long-running tasks asynchronously in the background but keep notifying the user of their progress and status via events, which is why they are known as event-based.
The following code shows an implementation of a component that uses EAP:
private static void EAPImplementation()
{
var webClient = new WebClient();
webClient.DownloadStringCompleted += (s, e) =>
{
if (e.Error != null)
Console.WriteLine(e.Error.Message);
else if (e.Cancelled)
Console.WriteLine...