void worker_DoWork(object sender, DoWorkEventArgs e) { host.Progress += host_Progress; try { host.DoAction(action, file); } finally { host.Progress -= host_Progress; } }