Esempio n. 1
0
 /// <summary>
 /// Confirms the specified title.
 /// </summary>
 /// <param name="title">The title.</param>
 /// <param name="message">The message.</param>
 /// <param name="text">The text.</param>
 /// <returns></returns>
 public static bool Confirm(string title, string message, MessageBoxText text)
 {
     WrappedMessageBox msg = new WrappedMessageBox();
     msg.Text = title;
     msg.Message = message;
     if (text == MessageBoxText.YesNo)
     {
         msg.button1.Text = "Yes";
         msg.button2.Text = "No";
     }
     else
     {
         msg.button1.Text = "OK";
         msg.button2.Text = "Cancel";
     }
     msg.button1.Click += delegate
     {
         msg.DialogResult = DialogResult.OK;
     };
     msg.button2.Click += delegate
     {
         msg.DialogResult = DialogResult.Cancel;
     };
     return msg.ShowDialog() == DialogResult.OK;
 }
Esempio n. 2
0
        /// <summary>
        /// Confirms the specified title.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="message">The message.</param>
        /// <param name="text">The text.</param>
        /// <returns></returns>
        public static bool Confirm(string title, string message, MessageBoxText text)
        {
            WrappedMessageBox msg = new WrappedMessageBox();

            msg.Text    = title;
            msg.Message = message;
            if (text == MessageBoxText.YesNo)
            {
                msg.button1.Text = "Yes";
                msg.button2.Text = "No";
            }
            else
            {
                msg.button1.Text = "OK";
                msg.button2.Text = "Cancel";
            }
            msg.button1.Click += delegate
            {
                msg.DialogResult = DialogResult.OK;
            };
            msg.button2.Click += delegate
            {
                msg.DialogResult = DialogResult.Cancel;
            };
            return(msg.ShowDialog() == DialogResult.OK);
        }
Esempio n. 3
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Shows a message box to warn the user about an invalid operation.
 /// </summary>
 /// <param name="message">The message for the user.</param>
 /// ------------------------------------------------------------------------------------
 protected override void ShowMessageBox(string message)
 {
     MessageBoxText.Add(message);
 }