Пример #1
0
        /// <summary>
        /// Prompts the user with a question
        /// </summary>
        /// <param name="text">question</param>
        /// <param name="caption">caption or subject</param>
        /// <param name="beep">Set to <c>true</c> to play a message beep, otherwise <c>false</c></param>
        /// <returns>Returns a <see cref="DialogResult"/> based on the users reaction</returns>
        public static DialogResult ShowQuestion(string text, string caption, bool beep)
        {
            if (beep)
            {
                Notifications.QuestionBeep();
            }

            return(FullScreenMessageBox.Show(
                       text,
                       caption,
                       MessageBoxButtons.YesNo,
                       MessageBoxIcon.Question,
                       MessageBoxDefaultButton.Button1));
        }
Пример #2
0
        /// <summary>
        /// Prompts the user with a warning
        /// </summary>
        /// <param name="text">warning</param>
        /// <param name="caption">caption or subject</param>
        /// <param name="beep">Set to <c>true</c> to play a message beep, otherwise <c>false</c></param>
        /// <returns>Returns a <see cref="DialogResult"/> based on the users reaction</returns>
        public static void ShowWarning(string text, string caption, bool beep)
        {
            if (beep)
            {
                Notifications.WarningBeep();
            }

            FullScreenMessageBox.Show(
                text,
                caption,
                MessageBoxButtons.OK,
                MessageBoxIcon.Exclamation,
                MessageBoxDefaultButton.Button1);
        }
Пример #3
0
        /// <summary>
        /// Prompts the user with an error
        /// </summary>
        /// <param name="exception">exception describing the error details</param>
        /// <param name="message">message to prompt</param>
        /// <param name="caption">caption or subject</param>
        /// <param name="beep">Set to <c>true</c> to play a message beep, otherwise <c>false</c></param>
        public static void ShowErrorDialog(Exception exception, string message, string caption, bool beep)
        {
            if (beep)
            {
                Notifications.ErrorBeep();
            }

            FullScreenMessageBox.Show(
                ErrorMessageBuilder.BuildExceptionMessage(exception, message),
                caption,
                MessageBoxButtons.OK,
                MessageBoxIcon.Exclamation,
                MessageBoxDefaultButton.Button1);
        }