internal DialogBoxAction Show(string message, string title, Macro.Common.MessageBoxActions buttons, IWin32Window owner) { #if !MONO // Ticket #7285: messages boxes should not be obscured by the splashscreen // If no splash screen is being displayed, this is effectively a no-op. SplashScreenManager.DismissSplashScreen(owner as Form); #endif title = string.IsNullOrEmpty(title) ? Application.Name : string.Format("{0} - {1}", Application.Name, title); using (var hook = new CommonDialogHook()) { var mbButtons = _buttonMap[(int)buttons]; // The OK-only message box has a single button whose control ID is actually "Cancel" if (mbButtons == MessageBoxButtons.OK) { hook.ButtonCaptions[2] = SR.ButtonOk; } var dr = System.Windows.Forms.MessageBox.Show(owner, message, title, mbButtons); return((DialogBoxAction)_resultMap[dr]); } }
public DialogBoxAction Show(string message, Macro.Common.MessageBoxActions buttons) { return(Show(message, null, buttons, null)); }