コード例 #1
0
 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();
 }
コード例 #2
0
        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());
        }