Code. Books. Outdoors.

Using BackgroundWorker to update status

I’ve been working on an application the past few days that iterates through directories and processes files within those directories. I was looking for a good way to keep the user informed of progress, and I decided that using System.ComponentModel.BackgroundWorker was my best solution.

Here’s some relevant code for how I used UserState to keep the user updated of the progress: