2016-02-19 13:05:04 -05:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Forms
|
|
|
|
|
{
|
|
|
|
|
class MesenMsgBox
|
|
|
|
|
{
|
|
|
|
|
public static DialogResult Show(string text, MessageBoxButtons buttons, MessageBoxIcon icon, params string[] args)
|
|
|
|
|
{
|
2016-05-02 20:22:17 -04:00
|
|
|
|
string resourceText = ResourceHelper.GetMessage(text, args);
|
|
|
|
|
|
|
|
|
|
if(resourceText.StartsWith("[[")) {
|
2016-05-22 14:43:07 -04:00
|
|
|
|
if(args != null && args.Length > 0) {
|
|
|
|
|
return MessageBox.Show(string.Format("Critical error (" + text + ") {0}", args), "Mesen", buttons, icon);
|
|
|
|
|
} else {
|
|
|
|
|
return MessageBox.Show(string.Format("Critical error (" + text + ")"), "Mesen", buttons, icon);
|
|
|
|
|
}
|
2016-05-02 20:22:17 -04:00
|
|
|
|
} else {
|
|
|
|
|
return MessageBox.Show(ResourceHelper.GetMessage(text, args), "Mesen", buttons, icon);
|
|
|
|
|
}
|
2016-02-19 13:05:04 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|