I\'m completely new to C# 5\'s new async/await keywords and I\'m interested in the best way to implement a progress event.
Now I\'d prefer
When using a Task.Run lambda I have used an Invoke Action inside of this to update a ProgressBar control. This may not be the best way but it worked in a pinch without having to restructure anything.
Invoke(new Action(() =>
{
LogProgress();
}));
Which takes it to...
private void LogProgress()
{
progressBar1.Value = Convert.ToInt32((100 * (1.0 * LinesRead / TotalLinesToRead)));
}