mtelligent

View Original

Exam 70 -553 - Manage a background process by using the BackgroundWorker component.

Section 3

  • Part 4

    Implementing Asynchronous Programming Techniques to Improve the User Experience

    • Topic 1

Manage a background process by using the BackgroundWorker component.

  • Run a background process by using the BackgroundWorker component.
  • Announce the completion of a background process by using the BackgroundWorker component.
  • Cancel a background process by using the BackgroundWorker component.
  • Report the progress of a background process by using the BackgroundWorker component.
  • Request the status of a background process by using the BackgroundWorker component.

Summary

New to .Net 2.0, the BackgroundWorker component is a component that can be dragged onto the form. It exposes a Do Work Event which is invoked Asyncronously when the components RunWorkerAsync Method is called.. This makes it a very easy way to introduce multithreading into an application.

The Background worker component also has a CancelAsync method to cancel the background process. It has a Report Progress Method to raise a Progress Changed event that can be used to respond to notifications.

Other Resources & Links:

BackgroundWorker Component Overview
http://msdn2.microsoft.com/en-us/library/8xs8549b.aspx

Multithreading with the BackgroundWorker Component
http://www.devsource.com/article2/0,1895,1893360,00.asp