634 lines
30 KiB
C#
634 lines
30 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using MMB.Forms;
|
|
using MyNes.Properties;
|
|
|
|
namespace MMB;
|
|
|
|
public sealed class ManagedMessageBox
|
|
{
|
|
private static Form_ManagedMesssageBox frm;
|
|
|
|
private static string clickedButton = "";
|
|
|
|
private static bool checkBoxChecked = false;
|
|
|
|
private static List<string> buttonsTemp;
|
|
|
|
private static Font defaultFont = new Font("Tahoma", 9f, FontStyle.Regular);
|
|
|
|
private static Color defaultBackgroundColor = SystemColors.Control;
|
|
|
|
private static Color defaultTextColor = Color.Black;
|
|
|
|
private static bool _rightToLeft = false;
|
|
|
|
public static Font DefaultMessageTextFont
|
|
{
|
|
get
|
|
{
|
|
return defaultFont;
|
|
}
|
|
set
|
|
{
|
|
defaultFont = value;
|
|
}
|
|
}
|
|
|
|
public static Color DefaultBackgroundColor
|
|
{
|
|
get
|
|
{
|
|
return defaultBackgroundColor;
|
|
}
|
|
set
|
|
{
|
|
defaultBackgroundColor = value;
|
|
}
|
|
}
|
|
|
|
public static Color DefaultMessageTextColor
|
|
{
|
|
get
|
|
{
|
|
return defaultTextColor;
|
|
}
|
|
set
|
|
{
|
|
defaultTextColor = value;
|
|
}
|
|
}
|
|
|
|
public static bool RightToLeft
|
|
{
|
|
get
|
|
{
|
|
return _rightToLeft;
|
|
}
|
|
set
|
|
{
|
|
_rightToLeft = value;
|
|
}
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, Control[] controls, ManagedMessageBoxIcon icon, bool showCheckBox, bool checkBoxValue, string checkBoxText, bool RightToLeft)
|
|
{
|
|
if (buttons == null)
|
|
{
|
|
throw new Exception("Unable to display Managed Message Box, no button passed !");
|
|
}
|
|
if (buttons.Length == 0)
|
|
{
|
|
throw new Exception("Unable to display Managed Message Box, no button passed !");
|
|
}
|
|
if (defaultButtonIndex < 0)
|
|
{
|
|
throw new Exception("Invalid default button value. It must be larger or equal 0 and less than buttons count");
|
|
}
|
|
if (defaultButtonIndex >= buttons.Length)
|
|
{
|
|
throw new Exception("Invalid default button value. It must be larger or equal 0 and less than buttons count");
|
|
}
|
|
frm = new Form_ManagedMesssageBox();
|
|
RichTextBox richTextBox = frm.richTextBox1;
|
|
TableLayoutPanel tableLayoutPanel = frm.tableLayoutPanel1;
|
|
Color color2 = (frm.BackColor = defaultBackgroundColor);
|
|
Color backColor = (tableLayoutPanel.BackColor = color2);
|
|
richTextBox.BackColor = backColor;
|
|
if (RightToLeft)
|
|
{
|
|
frm.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
|
|
frm.RightToLeftLayout = true;
|
|
}
|
|
frm.Text = messageCaption;
|
|
frm.label_message.Text = messageText;
|
|
frm.label_message.Font = defaultFont;
|
|
frm.label_message.ForeColor = defaultTextColor;
|
|
Label label_message = frm.label_message;
|
|
backColor = (frm.label_icon.BackColor = Color.Transparent);
|
|
label_message.BackColor = backColor;
|
|
switch (icon)
|
|
{
|
|
case ManagedMessageBoxIcon.None:
|
|
frm.label_icon.Visible = false;
|
|
break;
|
|
case ManagedMessageBoxIcon.Info:
|
|
frm.label_icon.Image = Resources.MessageIcon_Question;
|
|
break;
|
|
case ManagedMessageBoxIcon.Question:
|
|
frm.label_icon.Image = Resources.MessageIcon_Question;
|
|
break;
|
|
case ManagedMessageBoxIcon.Save:
|
|
frm.label_icon.Image = Resources.MessageIcon_Save;
|
|
break;
|
|
case ManagedMessageBoxIcon.Warning:
|
|
frm.label_icon.Image = Resources.MessageIcon_Warning;
|
|
break;
|
|
case ManagedMessageBoxIcon.Error:
|
|
frm.label_icon.Image = Resources.MessageIcon_Error;
|
|
break;
|
|
case ManagedMessageBoxIcon.Stop:
|
|
frm.label_icon.Image = Resources.MessageIcon_Stop;
|
|
break;
|
|
}
|
|
frm.checkBox1.Visible = showCheckBox;
|
|
frm.checkBox1.Text = checkBoxText;
|
|
frm.checkBox1.Checked = checkBoxValue;
|
|
buttonsTemp = new List<string>(buttons);
|
|
int num = 0;
|
|
frm.tableLayoutPanel1.ColumnCount = buttons.Length;
|
|
frm.tableLayoutPanel1.AutoSize = true;
|
|
for (int i = 0; i < buttons.Length; i++)
|
|
{
|
|
Button button = new Button();
|
|
button.Click += ManagedMessageBox_Click;
|
|
button.Text = buttons[i];
|
|
button.AutoSize = true;
|
|
if (i == defaultButtonIndex)
|
|
{
|
|
frm.AcceptButton = button;
|
|
}
|
|
frm.tableLayoutPanel1.Controls.Add(button);
|
|
frm.tableLayoutPanel1.SetColumn(button, i);
|
|
num += button.Width + frm.tableLayoutPanel1.Margin.All;
|
|
}
|
|
if (controls != null)
|
|
{
|
|
frm.tableLayoutPanel1.ColumnCount += controls.Length;
|
|
for (int j = 0; j < controls.Length; j++)
|
|
{
|
|
frm.tableLayoutPanel1.Controls.Add(controls[j]);
|
|
frm.tableLayoutPanel1.SetColumn(controls[j], frm.tableLayoutPanel1.Controls.Count - 1);
|
|
num += controls[j].Width + frm.tableLayoutPanel1.Margin.All;
|
|
}
|
|
}
|
|
int num2 = frm.Width;
|
|
int num3 = frm.Height;
|
|
if (num > frm.tableLayoutPanel1.Width)
|
|
{
|
|
num2 = num - frm.tableLayoutPanel1.Width;
|
|
num2 += frm.tableLayoutPanel1.Margin.All * 2;
|
|
num2 = frm.Width + num2;
|
|
if (num2 > 1000)
|
|
{
|
|
num2 = 1024;
|
|
}
|
|
}
|
|
int num4 = 0;
|
|
string[] array = messageText.Split('\n');
|
|
for (int k = 0; k < array.Length; k++)
|
|
{
|
|
_ = array[k];
|
|
Size size = TextRenderer.MeasureText(messageText, defaultFont);
|
|
double a = (double)size.Width / (double)(frm.label_message.Width - 20);
|
|
num4 += size.Height * (int)Math.Ceiling(a);
|
|
if (num4 > 1000)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
if (num4 > frm.label_message.Size.Height)
|
|
{
|
|
num3 += num4 - frm.label_message.Size.Height;
|
|
if (num3 > 1000)
|
|
{
|
|
frm.label_message.Visible = false;
|
|
frm.richTextBox1.Visible = true;
|
|
frm.richTextBox1.Text = messageText;
|
|
frm.richTextBox1.Font = defaultFont;
|
|
frm.richTextBox1.ForeColor = defaultTextColor;
|
|
num3 = frm.Height + 100;
|
|
}
|
|
}
|
|
frm.Size = new Size(num2, num3);
|
|
if (ParentWindow != null)
|
|
{
|
|
frm.ShowDialog(ParentWindow);
|
|
}
|
|
else
|
|
{
|
|
frm.ShowDialog();
|
|
}
|
|
return new ManagedMessageBoxResult(clickedButton, buttonsTemp.IndexOf(clickedButton), checkBoxChecked);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, Control[] controls, ManagedMessageBoxIcon icon, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, buttons, defaultButtonIndex, controls, icon, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, Control[] controls, ManagedMessageBoxIcon icon, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, buttons, defaultButtonIndex, controls, icon, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, Control[] controls, ManagedMessageBoxIcon icon)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, buttons, defaultButtonIndex, controls, icon, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, Control[] controls, ManagedMessageBoxIcon icon)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, buttons, defaultButtonIndex, controls, icon, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, ManagedMessageBoxIcon icon)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, buttons, defaultButtonIndex, null, icon, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, ManagedMessageBoxIcon icon)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, buttons, defaultButtonIndex, null, icon, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, ManagedMessageBoxIcon icon, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, buttons, defaultButtonIndex, null, icon, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText, string messageCaption, string[] buttons, int defaultButtonIndex, ManagedMessageBoxIcon icon, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, buttons, defaultButtonIndex, null, icon, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
private static void ManagedMessageBox_Click(object sender, EventArgs e)
|
|
{
|
|
clickedButton = ((Button)sender).Text;
|
|
checkBoxChecked = frm.checkBox1.Checked;
|
|
frm.Close();
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex)
|
|
{
|
|
return ShowCustomMessage(null, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, null, null, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex)
|
|
{
|
|
return ShowCustomMessage(ParentWindow, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, null, null, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex, Image icon)
|
|
{
|
|
return ShowCustomMessage(null, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, null, icon, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex, Image icon)
|
|
{
|
|
return ShowCustomMessage(ParentWindow, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, null, icon, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex, Control[] controls, Image icon)
|
|
{
|
|
return ShowCustomMessage(null, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, controls, icon, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex, Control[] controls, Image icon)
|
|
{
|
|
return ShowCustomMessage(ParentWindow, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, controls, icon, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex, Control[] controls, Image icon, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowCustomMessage(null, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, controls, icon, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex, Control[] controls, Image icon, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowCustomMessage(ParentWindow, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, controls, icon, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex, Control[] controls, Image icon, bool showCheckBox, bool checkBoxValue, string checkBoxText, bool RightToLeft)
|
|
{
|
|
return ShowCustomMessage(null, messageText, messageCaption, messageTextFont, messageTextColor, backgroundColor, buttons, defaultButtonIndex, controls, icon, showCheckBox, checkBoxValue, checkBoxText, RightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowCustomMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Font messageTextFont, Color messageTextColor, Color backgroundColor, string[] buttons, int defaultButtonIndex, Control[] controls, Image icon, bool showCheckBox, bool checkBoxValue, string checkBoxText, bool RightToLeft)
|
|
{
|
|
if (buttons == null)
|
|
{
|
|
throw new Exception("Unable to display Managed Message Box, no button passed !");
|
|
}
|
|
if (buttons.Length == 0)
|
|
{
|
|
throw new Exception("Unable to display Managed Message Box, no button passed !");
|
|
}
|
|
if (defaultButtonIndex < 0)
|
|
{
|
|
throw new Exception("Invalid default button value. It must be larger or equal 0 and less than buttons count");
|
|
}
|
|
if (defaultButtonIndex >= buttons.Length)
|
|
{
|
|
throw new Exception("Invalid default button value. It must be larger or equal 0 and less than buttons count");
|
|
}
|
|
frm = new Form_ManagedMesssageBox();
|
|
RichTextBox richTextBox = frm.richTextBox1;
|
|
TableLayoutPanel tableLayoutPanel = frm.tableLayoutPanel1;
|
|
Color color2 = (frm.BackColor = backgroundColor);
|
|
Color backColor = (tableLayoutPanel.BackColor = color2);
|
|
richTextBox.BackColor = backColor;
|
|
if (RightToLeft)
|
|
{
|
|
frm.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
|
|
frm.RightToLeftLayout = true;
|
|
}
|
|
frm.Text = messageCaption;
|
|
frm.label_message.Text = messageText;
|
|
frm.label_message.Font = messageTextFont;
|
|
frm.label_message.ForeColor = messageTextColor;
|
|
Label label_message = frm.label_message;
|
|
backColor = (frm.label_icon.BackColor = Color.Transparent);
|
|
label_message.BackColor = backColor;
|
|
if (icon != null)
|
|
{
|
|
frm.label_icon.Image = icon;
|
|
}
|
|
else
|
|
{
|
|
frm.label_icon.Visible = false;
|
|
}
|
|
frm.checkBox1.Visible = showCheckBox;
|
|
frm.checkBox1.Text = checkBoxText;
|
|
frm.checkBox1.Checked = checkBoxValue;
|
|
buttonsTemp = new List<string>(buttons);
|
|
int num = 0;
|
|
frm.tableLayoutPanel1.ColumnCount = buttons.Length;
|
|
frm.tableLayoutPanel1.AutoSize = true;
|
|
for (int i = 0; i < buttons.Length; i++)
|
|
{
|
|
Button button = new Button();
|
|
button.Click += ManagedMessageBox_Click;
|
|
button.Text = buttons[i];
|
|
button.AutoSize = true;
|
|
if (i == defaultButtonIndex)
|
|
{
|
|
frm.AcceptButton = button;
|
|
}
|
|
frm.tableLayoutPanel1.Controls.Add(button);
|
|
frm.tableLayoutPanel1.SetColumn(button, i);
|
|
num += button.Width + frm.tableLayoutPanel1.Margin.All;
|
|
}
|
|
if (controls != null)
|
|
{
|
|
frm.tableLayoutPanel1.ColumnCount += controls.Length;
|
|
for (int j = 0; j < controls.Length; j++)
|
|
{
|
|
frm.tableLayoutPanel1.Controls.Add(controls[j]);
|
|
frm.tableLayoutPanel1.SetColumn(controls[j], frm.tableLayoutPanel1.Controls.Count - 1);
|
|
num += controls[j].Width + frm.tableLayoutPanel1.Margin.All;
|
|
}
|
|
}
|
|
int num2 = frm.Width;
|
|
int num3 = frm.Height;
|
|
if (num > frm.tableLayoutPanel1.Width)
|
|
{
|
|
num2 = num - frm.tableLayoutPanel1.Width;
|
|
num2 += frm.tableLayoutPanel1.Margin.All * 2;
|
|
num2 = frm.Width + num2;
|
|
if (num2 > 1000)
|
|
{
|
|
num2 = 1000;
|
|
}
|
|
}
|
|
int num4 = 0;
|
|
string[] array = messageText.Split('\n');
|
|
for (int k = 0; k < array.Length; k++)
|
|
{
|
|
_ = array[k];
|
|
Size size = TextRenderer.MeasureText(messageText, defaultFont);
|
|
double a = (double)size.Width / (double)(frm.label_message.Width - 20);
|
|
num4 += size.Height * (int)Math.Ceiling(a);
|
|
if (num4 > 1000)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
if (num4 > frm.label_message.Size.Height)
|
|
{
|
|
num3 += num4 - frm.label_message.Size.Height;
|
|
if (num3 > 1000)
|
|
{
|
|
frm.label_message.Visible = false;
|
|
frm.richTextBox1.Visible = true;
|
|
frm.richTextBox1.Text = messageText;
|
|
frm.richTextBox1.Font = defaultFont;
|
|
frm.richTextBox1.ForeColor = defaultTextColor;
|
|
num3 = frm.Height + 100;
|
|
}
|
|
}
|
|
frm.Size = new Size(num2, num3);
|
|
if (ParentWindow != null)
|
|
{
|
|
frm.ShowDialog(ParentWindow);
|
|
}
|
|
else
|
|
{
|
|
frm.ShowDialog();
|
|
}
|
|
return new ManagedMessageBoxResult(clickedButton, buttonsTemp.IndexOf(clickedButton), checkBoxChecked);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(string messageText)
|
|
{
|
|
return ShowMessage(null, messageText, " ", ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Error, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(IWin32Window ParentWindow, string messageText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, " ", ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Error, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(string messageText, string messageCaption)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Error, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(IWin32Window ParentWindow, string messageText, string messageCaption)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Error, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(string messageText, string messageCaption, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Error, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(IWin32Window ParentWindow, string messageText, string messageCaption, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Error, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(string messageText, string messageCaption, Control[] controls)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Error, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Control[] controls)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Error, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(string messageText, string messageCaption, Control[] controls, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Error, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowErrorMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Control[] controls, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Error, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText)
|
|
{
|
|
return ShowMessage(null, messageText, " ", ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Info, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, " ", ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Info, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText, string messageCaption)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Info, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Info, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText, string messageCaption, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Info, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Info, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText, string messageCaption, Control[] controls)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Info, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Control[] controls)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Info, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(string messageText, string messageCaption, Control[] controls, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Info, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Control[] controls, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Info, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(string messageText)
|
|
{
|
|
return ShowMessage(null, messageText, " ", ManagedMessageBoxButtons.YesNo, 1, null, ManagedMessageBoxIcon.Question, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(IWin32Window ParentWindow, string messageText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, " ", ManagedMessageBoxButtons.YesNo, 1, null, ManagedMessageBoxIcon.Question, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(string messageText, string messageCaption)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.YesNo, 1, null, ManagedMessageBoxIcon.Question, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(IWin32Window ParentWindow, string messageText, string messageCaption)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.YesNo, 1, null, ManagedMessageBoxIcon.Question, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(string messageText, string messageCaption, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.YesNo, 1, null, ManagedMessageBoxIcon.Question, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(IWin32Window ParentWindow, string messageText, string messageCaption, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.YesNo, 1, null, ManagedMessageBoxIcon.Question, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(string messageText, string messageCaption, Control[] controls)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.YesNo, 1, controls, ManagedMessageBoxIcon.Question, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Control[] controls)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.YesNo, 1, controls, ManagedMessageBoxIcon.Question, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(string messageText, string messageCaption, Control[] controls, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.YesNo, 1, controls, ManagedMessageBoxIcon.Question, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowQuestionMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Control[] controls, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.YesNo, 1, controls, ManagedMessageBoxIcon.Question, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(string messageText)
|
|
{
|
|
return ShowMessage(null, messageText, " ", ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Warning, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(IWin32Window ParentWindow, string messageText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, " ", ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Warning, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(string messageText, string messageCaption)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Warning, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(IWin32Window ParentWindow, string messageText, string messageCaption)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Warning, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(string messageText, string messageCaption, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Warning, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(IWin32Window ParentWindow, string messageText, string messageCaption, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, null, ManagedMessageBoxIcon.Warning, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(string messageText, string messageCaption, Control[] controls)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Warning, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Control[] controls)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Warning, showCheckBox: false, checkBoxValue: false, "", _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(string messageText, string messageCaption, Control[] controls, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(null, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Warning, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
|
|
public static ManagedMessageBoxResult ShowWarningMessage(IWin32Window ParentWindow, string messageText, string messageCaption, Control[] controls, bool showCheckBox, bool checkBoxValue, string checkBoxText)
|
|
{
|
|
return ShowMessage(ParentWindow, messageText, messageCaption, ManagedMessageBoxButtons.OK, 0, controls, ManagedMessageBoxIcon.Warning, showCheckBox, checkBoxValue, checkBoxText, _rightToLeft);
|
|
}
|
|
}
|