private void RestoreImage_Click(object sender, EventArgs e) { this.Enabled = false; ImageBrick form = new ImageBrick(myBrick); try { form.ShowDialog(); } catch (ObjectDisposedException) { } //error raised if failed during initialization if (form.returnerror != null) { Status.Image = global::NXTLibTesterGUI.Properties.Resources.StatusAnnotations_Critical_16xLG_color; Status.Text = " " + form.returnerror; Status.ForeColor = Color.Firebrick; WriteMessage(form.returnerror); Disconnect_Click(sender, e); } else { Status.Image = global::NXTLibTesterGUI.Properties.Resources.StatusAnnotations_Complete_and_ok_16xLG_color; Status.Text = " Successfully imaged NXT!"; Status.ForeColor = Color.Green; WriteMessage("Successfully imaged NXT!"); } this.Enabled = true; }
private void RestoreImage_Click(object sender, EventArgs e) { this.Enabled = false; ImageBrick form = new ImageBrick(myBrick); try { form.ShowDialog(); } catch (ObjectDisposedException) { } //error raised if failed during initialization if (form.returnerror != null) { Status.Image = global::NXTLibTesterGUI.Properties.Resources.StatusAnnotations_Critical_16xLG_color; Status.Text = " " + form.returnerror; Status.ForeColor = Color.Firebrick; WriteMessage(form.returnerror); Disconnect_Click(sender, e); } else { Status.Image = global::NXTLibTesterGUI.Properties.Resources.StatusAnnotations_Complete_and_ok_16xLG_color; Status.Text = " Successfully imaged NXT!"; Status.ForeColor = Color.Green; WriteMessage("Successfully imaged NXT!"); } this.Enabled = true; }