Which of the following code segments should you use to define a member of that class to signal asynchronous completion?

You are using the following class to download jobs.

public class Job
{
public void Download[]
{
}
}

You need to use the event-based asynchronous pattern to support asynchronous job downloads. Which of the following code segments should you use to define a member of that class to signal asynchronous completion?

You are using the following class to download jobs.

public class Job
{
public void Download[]
{
}
}

You need to use the event-based asynchronous pattern to support asynchronous job downloads. Which of the following code segments should you use to define a member of that class to signal asynchronous completion?

A.
public bool DownloadCompleted;

B.
public void DownloadCompleted[]
{
}

C.
public DownloadCompletedEventHandler DownloadCompleted[] {
Return null;
}

D.
public DownloadCompletedEventHandler DownloadCompleted;

Explanation:
If you have the event-based asynchronous patter, a worker thread raises an event to indicate completion of an asynchronous process. The event should have the same name of the synchronous method suffixed with "Completed".

Incorrect Answers:
A, B, C: You should not define a method or field named DownloadCompleted. A event must be define to signal notification.



Leave a Reply 0

Your email address will not be published. Required fields are marked *