public static DialogResult ShowDialog(Exception ex, string caption, DialogResult enabledButtons) { ExceptionRetryDialog dlg = new ExceptionRetryDialog(); dlg.PopulateWithException(ex); if (!string.IsNullOrWhiteSpace(caption)) dlg.ExceptionName = caption; if (!enabledButtons.HasFlag(DialogResult.Abort)) dlg.abortButton.Enabled = false; if (!enabledButtons.HasFlag(DialogResult.Ignore)) dlg.ignoreButton.Enabled = false; if (!enabledButtons.HasFlag(DialogResult.Retry)) dlg.retryButton.Enabled = false; return dlg.ShowDialog(); }
public static DialogResult ShowDialog(Exception ex, string caption, DialogResult enabledButtons) { ExceptionRetryDialog dlg = new ExceptionRetryDialog(); dlg.PopulateWithException(ex); if (!string.IsNullOrWhiteSpace(caption)) { dlg.ExceptionName = caption; } if (!enabledButtons.HasFlag(DialogResult.Abort)) { dlg.abortButton.Enabled = false; } if (!enabledButtons.HasFlag(DialogResult.Ignore)) { dlg.ignoreButton.Enabled = false; } if (!enabledButtons.HasFlag(DialogResult.Retry)) { dlg.retryButton.Enabled = false; } return(dlg.ShowDialog()); }