本文整理汇总了C#中MessageBoxOptions类的典型用法代码示例。如果您正苦于以下问题:C# MessageBoxOptions类的具体用法?C# MessageBoxOptions怎么用?C# MessageBoxOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageBoxOptions类属于命名空间,在下文中一共展示了MessageBoxOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Show
public static MessageBoxResult Show(
Action<Window> setOwner,
CultureInfo culture,
string messageBoxText,
string caption,
WPFMessageBoxButton button,
MessageBoxImage icon,
MessageBoxResult defaultResult,
MessageBoxOptions options)
{
if ((options & MessageBoxOptions.DefaultDesktopOnly) == MessageBoxOptions.DefaultDesktopOnly)
{
throw new NotImplementedException();
}
if ((options & MessageBoxOptions.ServiceNotification) == MessageBoxOptions.ServiceNotification)
{
throw new NotImplementedException();
}
//LocalizeDictionary.Instance.Culture = CultureInfo.GetCultureInfo("de");
_messageBoxWindow = new WPFMessageBoxWindow();
setOwner(_messageBoxWindow);
PlayMessageBeep(icon);
//FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(
// XmlLanguage.GetLanguage(culture.IetfLanguageTag)));
_messageBoxWindow._viewModel = new MessageBoxViewModel(_messageBoxWindow, culture, caption, messageBoxText, button, icon, defaultResult, options);
_messageBoxWindow.DataContext = _messageBoxWindow._viewModel;
_messageBoxWindow.ShowDialog();
return _messageBoxWindow._viewModel.Result;
}
示例2: Show
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, MessageBoxOptions options)
{
_owner = owner;
Initialize();
return MessageBox.Show(owner, text, caption, buttons, icon,
defButton, options);
}
示例3: AlertDialogBackend
public AlertDialogBackend()
{
this.buttons = MessageBoxButton.OKCancel;
this.icon = MessageBoxImage.None;
this.options = MessageBoxOptions.None;
this.defaultResult = MessageBoxResult.Cancel;
}
示例4: Show
/// <include file='doc\MessageBox.uex' path='docs/doc[@for="MessageBox.Show6"]/*' />
/// <devdoc>
/// <para>
/// Displays a message box with specified text, caption, and style.
/// Makes the dialog RTL if the resources for this dll have been localized to a RTL language.
/// </para>
/// </devdoc>
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options) {
if (RTLAwareMessageBox.IsRTLResources) {
options |= (MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading);
}
return MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options);
}
示例5: KryptonMessageBox
private KryptonMessageBox(string text, string caption,
MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options,
HelpInfo helpInfo)
{
// Store incoming values
_text = text;
_caption = caption;
_buttons = buttons;
_icon = icon;
_defaultButton = defaultButton;
_options = options;
_helpInfo = helpInfo;
// Create the form contents
InitializeComponent();
// Update contents to match requirements
UpdateText();
UpdateIcon();
UpdateButtons();
UpdateDefault();
UpdateHelp();
// Finally calculate and set form sizing
UpdateSizing();
}
示例6: Show
public static MessageBoxResult Show(
Action<Window> setOwner,
string messageBoxText,
string caption,
MessageBoxButton button,
MessageBoxImage icon,
MessageBoxResult defaultResult,
MessageBoxOptions options)
{
if ((options & MessageBoxOptions.DefaultDesktopOnly) == MessageBoxOptions.DefaultDesktopOnly)
{
throw new NotImplementedException();
}
if ((options & MessageBoxOptions.ServiceNotification) == MessageBoxOptions.ServiceNotification)
{
throw new NotImplementedException();
}
_messageBoxWindow = new WpfMessageBoxWindow();
setOwner(_messageBoxWindow);
PlayMessageBeep(icon);
_messageBoxWindow._viewModel = new MessageBoxViewModel(_messageBoxWindow, caption, messageBoxText, button, icon, defaultResult, options);
_messageBoxWindow.DataContext = _messageBoxWindow._viewModel;
_messageBoxWindow.ShowDialog();
return _messageBoxWindow._viewModel.Result;
}
示例7: Show
///-------------------------------------------------------------------------------------------------
/// <summary> Shows. </summary>
///
/// <remarks> Justin, 7/11/2015. </remarks>
///
/// <param name="message"> The message. </param>
/// <param name="result"> The result. </param>
/// <param name="state"> The state. </param>
/// <param name="ok"> The ok. </param>
/// <param name="messageBoxIcon"> The message box icon. </param>
/// <param name="button1"> The first button. </param>
/// <param name="serviceNotification"> The service notification. </param>
///-------------------------------------------------------------------------------------------------
public static void Show(string message, string result, TcpState state, MessageBoxButtons ok, MessageBoxIcon messageBoxIcon,
MessageBoxDefaultButton button1, MessageBoxOptions serviceNotification)
{
MessageBox.Show(String.Format("{0} result: {1}, Tcp State: {2}", message, result, state),
@"Information", ok,
messageBoxIcon, button1,
serviceNotification);
}
示例8: Show
/// ------------------------------------------------------------------------------------
/// <summary>
/// This implementation displays the message in the Console and returns the first
/// button as dialog result.
/// </summary>
/// ------------------------------------------------------------------------------------
public DialogResult Show(IWin32Window owner, string text, string caption,
MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton,
MessageBoxOptions options, string helpFilePath, HelpNavigator navigator, object param)
{
Console.WriteLine("**** {0}: {1}{3}{2}", caption, text, buttons, Environment.NewLine);
return TranslateButtons(buttons);
}
示例9: Show
public static DialogResult Show(IWin32Window owner, string text,
string caption, MessageBoxButtons buttons, MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
{
return MessageBox.Show(owner, text, caption,
buttons, icon, defaultButton, getDefaultOptions(owner) | options);
}
示例10: DialogEventArgs
//public DialogEventArgs(string text, string caption)
// : this(text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0)
//{
//}
public DialogEventArgs(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
{
this.text = text;
this.caption = caption;
this.buttons = buttons;
this.icon = icon;
this.defaultButton = defaultButton;
this.options = options;
}
示例11: Show
public static DialogResult Show(
string text,
string caption,
MessageBoxButtons buttons,
MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton,
MessageBoxOptions options )
{
return MessageBox.Show( text, caption, buttons, icon, defaultButton, options );
}
示例12: Show
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons,
MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
{
if (IsRightToLeft(owner))
{
options |= MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign;
}
return MessageBox.Show(owner, text, caption, buttons, icon, defaultButton, options);
}
示例13: ShowMessage
public DialogResult ShowMessage(
string text,
string caption,
MessageBoxButtons buttons,
MessageBoxIcon icon,
MessageBoxDefaultButton defaultButton,
MessageBoxOptions options,
bool displayHelpButton)
{
return MessageBox.Show(text, caption, buttons, icon, defaultButton, options, displayHelpButton);
}
示例14: ShowMessageBox
public void ShowMessageBox(string message, string title = "Hello Screens", MessageBoxOptions options = MessageBoxOptions.Ok, Action<IMessageBox> callback = null) {
var box = createMessageBox();
box.DisplayName = title;
box.Options = options;
box.Message = message;
if(callback != null)
box.Deactivated += delegate { callback(box); };
ActivateItem(box);
}
示例15: Show
public static MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, MessageBoxOptions options)
{
MessageBoxResult result = defaultResult;
Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(
() =>
{
Window newWindow = new Window() { Topmost = true };
result = MessageBox.Show(newWindow, messageBoxText, caption, button, icon, defaultResult, options);
newWindow.Close();
}));
return (result);
}