/// ------------------------------------------------------------------------------------ /// <summary> /// Displays a speech tools message box. /// </summary> /// ------------------------------------------------------------------------------------ public static DialogResult MsgBox(string msg, MessageBoxButtons buttons, MessageBoxIcon icon) { if (SuppressMsgBoxInteractions) { return(DialogResult.None); } // If there a splash screen showing, then close it. Otherwise, // the message box will popup behind the splash screen. if (s_splashScreen != null) { s_splashScreen.Close(); } s_msgBoxJustShown = true; msg = ConvertLiteralNewLines(msg); msg = msg.Replace(kObjReplacementChar.ToString(CultureInfo.InvariantCulture), Environment.NewLine); MessageBoxExtender.OK = LocalizationManager.GetString("CustomMessageBox.OK", "OK"); MessageBoxExtender.Abort = LocalizationManager.GetString("CustomMessageBox.Abort", "Abort"); MessageBoxExtender.Cancel = LocalizationManager.GetString("CustomMessageBox.Cancel", "Cancel"); MessageBoxExtender.Ignore = LocalizationManager.GetString("CustomMessageBox.Ignore", "Ignore"); MessageBoxExtender.No = LocalizationManager.GetString("CustomMessageBox.No", "No"); MessageBoxExtender.Retry = LocalizationManager.GetString("CustomMessageBox.Retry", "Retry"); MessageBoxExtender.Yes = LocalizationManager.GetString("CustomMessageBox.Yes", "Yes"); MessageBoxExtender.Register(); var title = LocalizationManager.GetString("MainWindow.WindowTitle.WithOutProject", Application.ProductName); return(MessageBox.Show(msg, title, buttons, icon)); }
private static string MappingButtonText(string msg) { msg = ConvertLiteralNewLines(msg); msg = msg.Replace(kObjReplacementChar.ToString(CultureInfo.InvariantCulture), Environment.NewLine); MessageBoxExtender.OK = LocalizationManager.GetString("CustomMessageBox.OK", "OK"); MessageBoxExtender.Abort = LocalizationManager.GetString("CustomMessageBox.Abort", "Abort"); MessageBoxExtender.Cancel = LocalizationManager.GetString("CustomMessageBox.Cancel", "Cancel"); MessageBoxExtender.Ignore = LocalizationManager.GetString("CustomMessageBox.Ignore", "Ignore"); MessageBoxExtender.No = LocalizationManager.GetString("CustomMessageBox.No", "No"); MessageBoxExtender.Retry = LocalizationManager.GetString("CustomMessageBox.Retry", "Retry"); MessageBoxExtender.Yes = LocalizationManager.GetString("CustomMessageBox.Yes", "Yes"); MessageBoxExtender.Register(); return(msg); }