Пример #1
0
        /// <summary>
        /// Displays a message box that has a message, title bar caption, button, and icon; and that returns a result.
        /// </summary>
        /// <param name="messageBoxText">A System.String that specifies the text to display.</param>
        /// <param name="caption">A System.String that specifies the title bar caption to display.</param>
        /// <param name="button">A System.Windows.MessageBoxButton value that specifies which button or buttons to display.</param>
        /// <param name="icon">A System.Windows.MessageBoxImage value that specifies the icon to display.</param>
        /// <returns>A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.</returns>
        public static AltMessageBoxResult Show(string messageBoxText, string caption, AltMessageBoxButton button, MessageBoxImage icon)
        {
            AltMessageBox msg = new AltMessageBox(messageBoxText, caption, button, icon);

            msg.ShowDialog();

            return(msg.Result);
        }
Пример #2
0
        /// <summary>
        /// Displays a message box that has a message and returns a result.
        /// </summary>
        /// <param name="messageBoxText">A System.String that specifies the text to display.</param>
        /// <returns>A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.</returns>
        public static AltMessageBoxResult Show(string messageBoxText)
        {
            AltMessageBox msg = new AltMessageBox(messageBoxText);

            msg.ShowDialog();

            return(msg.Result);
        }
Пример #3
0
        /// <summary>
        /// Displays a message box in front of the specified window. The message box displays a message and title bar caption; and it returns a result.
        /// </summary>
        /// <param name="owner">A System.Windows.Window that represents the owner window of the message box.</param>
        /// <param name="messageBoxText">A System.String that specifies the text to display.</param>
        /// <param name="caption">A System.String that specifies the title bar caption to display.</param>
        /// <returns>A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.</returns>
        public static AltMessageBoxResult Show(Window owner, string messageBoxText, string caption)
        {
            AltMessageBox msg = new AltMessageBox(messageBoxText, caption);

            msg.Owner = owner;
            msg.ShowDialog();

            return(msg.Result);
        }
Пример #4
0
        /// <summary>
        /// Displays a message box that has a message, title bar caption, OK button with a custom System.String value for the button's text, and icon; and that returns a result.
        /// </summary>
        /// <param name="messageBoxText">A System.String that specifies the text to display.</param>
        /// <param name="caption">A System.String that specifies the title bar caption to display.</param>
        /// <param name="okButtonText">A System.String that specifies the text to display within the OK button.</param>
        /// <param name="icon">A System.Windows.MessageBoxImage value that specifies the icon to display.</param>
        /// <returns>A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.</returns>
        public static AltMessageBoxResult ShowOK(string messageBoxText, string caption, string okButtonText, MessageBoxImage icon)
        {
            AltMessageBox msg = new AltMessageBox(messageBoxText, caption, AltMessageBoxButton.OK, icon);

            msg.OkButtonText = okButtonText;

            msg.ShowDialog();

            return(msg.Result);
        }
Пример #5
0
        /// <summary>
        /// Displays a message box that has a message, caption, Yes/No buttons with custom System.String values for the buttons' text, and icon;
        /// and that returns a result.
        /// </summary>
        /// <param name="messageBoxText">A System.String that specifies the text to display.</param>
        /// <param name="caption">A System.String that specifies the title bar caption to display.</param>
        /// <param name="yesButtonText">A System.String that specifies the text to display within the Yes button.</param>
        /// <param name="noButtonText">A System.String that specifies the text to display within the No button.</param>
        /// <param name="icon">A System.Windows.MessageBoxImage value that specifies the icon to display.</param>
        /// <returns>A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.</returns>
        public static AltMessageBoxResult ShowYesNo(string messageBoxText, string caption, string yesButtonText, string noButtonText, MessageBoxImage icon)
        {
            AltMessageBox msg = new AltMessageBox(messageBoxText, caption, AltMessageBoxButton.YesNo, icon);

            msg.YesButtonText = yesButtonText;
            msg.NoButtonText  = noButtonText;

            msg.ShowDialog();

            return(msg.Result);
        }
Пример #6
0
        /// <summary>
        /// Displays a message box that has a message, caption, and OK/Cancel buttons with custom System.String values for the buttons' text;
        /// and that returns a result.
        /// </summary>
        /// <param name="messageBoxText">A System.String that specifies the text to display.</param>
        /// <param name="caption">A System.String that specifies the title bar caption to display.</param>
        /// <param name="okButtonText">A System.String that specifies the text to display within the OK button.</param>
        /// <param name="cancelButtonText">A System.String that specifies the text to display within the Cancel button.</param>
        /// <returns>A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.</returns>
        public static AltMessageBoxResult ShowOKCancel(string messageBoxText, string caption, string okButtonText, string cancelButtonText)
        {
            AltMessageBox msg = new AltMessageBox(messageBoxText, caption, AltMessageBoxButton.OKCancel);

            msg.OkButtonText     = okButtonText;
            msg.CancelButtonText = cancelButtonText;

            msg.ShowDialog();

            return(msg.Result);
        }
Пример #7
0
        /// <summary>
        /// Displays a message box that has a message, caption, and Yes/No/Cancel buttons with custom System.String values for the buttons' text;
        /// and that returns a result.
        /// </summary>
        /// <param name="messageBoxText">A System.String that specifies the text to display.</param>
        /// <param name="caption">A System.String that specifies the title bar caption to display.</param>
        /// <param name="yesButtonText">A System.String that specifies the text to display within the Yes button.</param>
        /// <param name="noButtonText">A System.String that specifies the text to display within the No button.</param>
        /// <param name="cancelButtonText">A System.String that specifies the text to display within the Cancel button.</param>
        /// <returns>A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.</returns>
        public static AltMessageBoxResult ShowYesNoCancel(string messageBoxText, string caption, string yesButtonText, string noButtonText, string cancelButtonText)
        {
            AltMessageBox msg = new AltMessageBox(messageBoxText, caption, AltMessageBoxButton.YesNoCancel);

            msg.YesButtonText    = yesButtonText;
            msg.NoButtonText     = noButtonText;
            msg.CancelButtonText = cancelButtonText;

            msg.ShowDialog();

            return(msg.Result);
        }
Пример #8
0
        /// <summary>
        /// Displays a message box flexible to your liking.
        /// </summary>
        /// <param name="param">Defines what the messagebox does</param>
        /// <returns>A System.Windows.MessageBoxResult value that specifies which message box button is clicked by the user.</returns>
        public static AltMessageBoxResult Show(AltMessageBoxArgs param)
        {
            AltMessageBox msg = new AltMessageBox(param);

            if (param.OKText != string.Empty)
            {
                msg.OkButtonText = param.OKText;
            }
            if (param.YesText != string.Empty)
            {
                msg.YesButtonText = param.YesText;
            }
            if (param.NoText != string.Empty)
            {
                msg.NoButtonText = param.NoText;
            }
            if (param.CancelText != string.Empty)
            {
                msg.CancelButtonText = param.CancelText;
            }
            if (param.RetryText != string.Empty)
            {
                msg.RetryButtonText = param.RetryText;
            }
            if (param.AbortText != string.Empty)
            {
                msg.AbortButtonText = param.AbortText;
            }
            if (param.YesToAllText != string.Empty)
            {
                msg.YesToAllButtonText = param.YesToAllText;
            }
            if (param.NoToAllText != string.Empty)
            {
                msg.NoToAllButtonText = param.NoToAllText;
            }
            msg.ShowDialog();

            return(msg.Result);
        }