Fix Cross Threading Exception on successful iso write
Status: Beta
Brought to you by:
epurasu
The function creator_Finished in MainForm.cs (~line 94) raises a cross thread exception by trying to access buttonStartAbort from a different thread than it was created on. There is an easy fix for this; wrap the UI manipulation code in an Invoke statement:
<code>
void creator_Finished( object sender, FinishEventArgs e ) {
MessageBox.Show( e.Message, "Finish", MessageBoxButtons.OK, MessageBoxIcon.Information );
this.Invoke(new EventHandler((o1,e1)=>
{
//avoid cross-thread exception
Console.WriteLine("called from within invoke");
buttonStartAbort.Enabled = true;
buttonStartAbort.Text = "Start";
progressBar.Value = 0;
labelStatus.Text = "Process not started";
}));
}
</code>