public static void ErrorMessageBox(IWin32Window owner, Exception exception, string messageFormat, params object[] args) { if (!CollectionUtils.IsNullOrEmpty(args)) { messageFormat = string.Format(messageFormat, args); } if (exception != null) { if (!messageFormat.EndsWith(":") && !messageFormat.EndsWith(".")) { messageFormat += ":"; } messageFormat += Environment.NewLine + Environment.NewLine; if (ShowDetailedErrorMessages) { messageFormat += ExceptionUtils.ToLongString(exception); } else { messageFormat += ExceptionUtils.GetDeepExceptionMessage(exception); messageFormat = messageFormat.Replace(", Message:", Environment.NewLine + Environment.NewLine + "Message:"); } } XTRA_MSG_BOX.Show(owner, WrapMessage(messageFormat), Application.ProductName + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error, exception); }
public static void InformationMessageBox(IWin32Window owner, string messageFormat, params object[] args) { if (!CollectionUtils.IsNullOrEmpty(args)) { messageFormat = string.Format(messageFormat, args); } XTRA_MSG_BOX.Show(owner, WrapMessage(messageFormat), Application.ProductName + " Information", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public static bool WarningYesNoMessageBox(IWin32Window owner, string messageFormat, params object[] args) { if (!CollectionUtils.IsNullOrEmpty(args)) { messageFormat = string.Format(messageFormat, args); } messageFormat += Environment.NewLine; return(XTRA_MSG_BOX.Show(owner, WrapMessage(messageFormat), Application.ProductName + " Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes); }
public static bool InformationMessageBoxOkCancel(IWin32Window owner, string messageFormat, params object[] args) { if (!CollectionUtils.IsNullOrEmpty(args)) { messageFormat = string.Format(messageFormat, args); } DialogResult result = XTRA_MSG_BOX.Show(owner, WrapMessage(messageFormat), Application.ProductName + " Information", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); return(result == DialogResult.OK); }
private static bool QuestionMessageBox(IWin32Window owner, MessageBoxButtons buttons, string messageFormat, params object[] args) { if (!CollectionUtils.IsNullOrEmpty(args)) { messageFormat = string.Format(messageFormat, args); } messageFormat += Environment.NewLine; DialogResult positiveResponse = (buttons == MessageBoxButtons.YesNo) ? DialogResult.Yes : DialogResult.OK; return(XTRA_MSG_BOX.Show(owner, WrapMessage(messageFormat), Application.ProductName + " Question", buttons, MessageBoxIcon.Question) == positiveResponse); }
public static DialogResult YesNoCancelMessageBox(IWin32Window owner, ref bool dontShowAgainChecked, string messageFormat, params object[] args) { if (!CollectionUtils.IsNullOrEmpty(args)) { messageFormat = string.Format(messageFormat, args); } messageFormat += Environment.NewLine; string dontShowAgainText = DefaultDontShowMessageBoxAgainText; return(XTRA_MSG_BOX.Show(owner, WrapMessage(messageFormat), Application.ProductName + " Question", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, dontShowAgainText, ref dontShowAgainChecked)); }
public static void InformationMessageBox(IWin32Window owner, string dontShowAgainText, ref bool dontShowAgainChecked, string messageFormat, params object[] args) { if (!CollectionUtils.IsNullOrEmpty(args)) { messageFormat = string.Format(messageFormat, args); } if (string.IsNullOrEmpty(dontShowAgainText)) { dontShowAgainText = DefaultDontShowMessageBoxAgainText; } XTRA_MSG_BOX.Show(owner, WrapMessage(messageFormat), Application.ProductName + " Information", MessageBoxButtons.OK, MessageBoxIcon.Information, dontShowAgainText, ref dontShowAgainChecked); }