using System.Windows.Forms; namespace Netch.Utils { class MessageBoxX { /// /// /// 内容 /// 自定义标题 /// 弹窗等级 (标题, 图标) /// 需要确认 /// 阻止 owner Focus() 直到 Messageox 被关闭 public static DialogResult Show(string text, string title = "", bool info = true, bool confirm = false,IWin32Window owner = null) { return MessageBox.Show( owner: owner, text: i18N.Translate(text: text), caption: i18N.Translate(string.IsNullOrWhiteSpace(title) ? (info ? "Information" : "Error") : title), buttons: confirm ? MessageBoxButtons.OKCancel : MessageBoxButtons.OK, icon: info ? MessageBoxIcon.Information : MessageBoxIcon.Exclamation); } } }