public delegate void UpdateProgressBarDelegate(ImGearRecProgressEventArgs e);
UpdateProgressBarDelegate progressDelegate = null;
void UpdateProgressBar(ImGearRecProgressEventArgs e)
{
if (e.Percent < 100)
toolStripStatusProgress.Text = e.Process + " - " + e.Percent + "%";
else
toolStripStatusProgress.Text = "Ready";
this.Update();
}
private void recProgress(object sender, ImGearRecProgressEventArgs e)
{
if(this.InvokeRequired)
{
object[] arg = new object[1];
arg[0] = e;
this.Invoke(progressDelegate, arg);
}
else
{
UpdateProgressBar(e);
}
}