public ErrorResult NotifyUserOfProblem(IRepeatNoticePolicy policy,
									string alternateButton1Label,
									ErrorResult resultIfAlternateButtonPressed,
									string message)
        {
            if (!policy.ShouldShowMessage(message))
            {
                return ErrorResult.OK;
            }

            if (ErrorReport.IsOkToInteractWithUser)
            {
                var dlg = new ProblemNotificationDialog(message, UsageReporter.AppNameToUseInDialogs + " Problem")
                {
                    ReoccurenceMessage = policy.ReoccurenceMessage

                };
                if (!string.IsNullOrEmpty(alternateButton1Label))
                {
                    dlg.EnableAlternateButton1(alternateButton1Label, GetDialogResultForErrorResult(resultIfAlternateButtonPressed));
                }
                return GetErrorResultForDialogResult(dlg.ShowDialog());
            }
            else
            {
                throw new ErrorReport.ProblemNotificationSentToUserException(message);
            }
        }
Example #2
0
        public ErrorResult NotifyUserOfProblem(IRepeatNoticePolicy policy,
                                               string alternateButton1Label,
                                               ErrorResult resultIfAlternateButtonPressed,
                                               string message)
        {
            if (!policy.ShouldShowMessage(message))
            {
                return(ErrorResult.OK);
            }

            if (ErrorReport.IsOkToInteractWithUser)
            {
                var dlg = new ProblemNotificationDialog(message, UsageReporter.AppNameToUseInDialogs + " Problem")
                {
                    ReoccurenceMessage = policy.ReoccurenceMessage
                };
                if (!string.IsNullOrEmpty(alternateButton1Label))
                {
                    dlg.EnableAlternateButton1(alternateButton1Label, GetDialogResultForErrorResult(resultIfAlternateButtonPressed));
                }
                return(GetErrorResultForDialogResult(dlg.ShowDialog()));
            }
            else
            {
                throw new ErrorReport.ProblemNotificationSentToUserException(message);
            }
        }
		public static void Show(string message)
		{
			using (var d = new ProblemNotificationDialog(message, "Problem"))
				d.ShowDialog();
		}
 public static void Show(string message)
 {
     using (var d = new ProblemNotificationDialog(message, "Problem"))
         d.ShowDialog();
 }