private void Cancel_Click(object sender, EventArgs e) { if (MessageBox.Show(this, "Are you sure you want to stop the process? This operation cannot be undone.", "Confirmation required.", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { CancellationRequest?.Invoke(this, EventArgs.Empty); } }
public void OnCancellationRequest(object sender, EventArgs e) { CancellationRequest?.Invoke(sender, e); }