You are working as an application developer at Domain.com. The Domain.com network consists of a single Active Directory domain named Domain.com. Domain.com uses Visual Studio 2005 as an application platform. Domain.com consists of a Development department.
You as the developer of Domain.com use a client computer named Certkiller -WS014 as developing collateral.
You are busy using a BackgroundWorker component, set to its default value, to execute an asynchronous operation.
What should you do to receive notification when the operation completes?
A.
You should handle the ProgressChanged event.
B.
You should handle the RunWorkerCompleted event.
C.
You should call the WaitAny method of the WaitHandle class.
D.
You should call the WaitAll method of the WaitHandle class.
Explanation:
The BackgroundWorker class has a method called RunWorkerCompleted, when called; it raises a DoWork event in a separate thread. When ever the background thread is complete, the component raises the RunWorkerCompleted event.Incorrect Answers:
A: The ProgressChanged is raised when the background thread calls the ReportProgress method.
C: The WaitAny causes the current thread to block until at least one wait handle in the specified WaitHandle array is signaled as complete.
D: The WaitAll causes the current thread to block until one wait handle in the specified WaitHandle array is signaled as complete.
B: Announce the completion of a background process by using the BackgroundWorker component.