void creator_Abort(object sender, AbortEventArgs e) { MessageBox.Show(e.Message, "Abort", MessageBoxButtons.OK, MessageBoxIcon.Stop); MessageBox.Show("The ISO creating process has been stopped.", "Abort", MessageBoxButtons.OK, MessageBoxIcon.Stop); button2.Invoke(new Action(() => button2.Enabled = false)); progressBar.Invoke(new Action(() => progressBar.Value = 0)); progressBar.Invoke(new Action(() => progressBar.Maximum = 0)); labelStatus.Invoke(new Action(() => labelStatus.Text = "Process not started")); }
void creator_Abort(object sender, AbortEventArgs e) { MessageBox.Show(e.Message, "Abort", MessageBoxButtons.OK, MessageBoxIcon.Stop); MessageBox.Show("The ISO creating process has been stopped.", "Abort", MessageBoxButtons.OK, MessageBoxIcon.Stop); buttonStartAbort.Enabled = true; buttonStartAbort.Text = "Start"; progressBar.Value = 0; progressBar.Maximum = 0; labelStatus.Text = "Process not started"; }
// Wrap event invocations inside a protected virtual method protected virtual void OnAbortEventHandler(AbortEventArgs e) { // Make a temporary copy of the event to avoid possibility of // a race condition if the last subscriber unsubscribes // immediately after the null check and before the event is raised. AbortEventHandler?.Invoke(this, e); // LogEventHandler thisEvent = ThisEvent; //assign the event to a local variable // If(thisEvent != null) // { // thisEvent(this, args); // } }
void creator_Abort(object sender, AbortEventArgs e) { MessageBox.Show(e.Message, "Abort", MessageBoxButtons.OK, MessageBoxIcon.Stop); MessageBox.Show("The ISO creating process has been stopped.", "Abort", MessageBoxButtons.OK, MessageBoxIcon.Stop); if (!this.InvokeRequired) { this.EnableStart(); this.SetProgressMaximum(0); } else { this.Invoke(new Action(() => { this.EnableStart(); this.SetProgressMaximum(0); })); } }
protected override void OnProtocolAbort(AbortEventArgs e) { base.OnProtocolAbort(e); }