当前位置: 首页>>代码示例>>C#>>正文


C# MessageBoxOptions类代码示例

本文整理汇总了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;
        }
开发者ID:nullkuhl,项目名称:driverGalaxy-release,代码行数:32,代码来源:WPFMessageBoxWindow.xaml.cs

示例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);
 }
开发者ID:gitsly,项目名称:CodingSandbox,代码行数:7,代码来源:MessageBoxCentered.cs

示例3: AlertDialogBackend

 public AlertDialogBackend()
 {
     this.buttons = MessageBoxButton.OKCancel;
     this.icon = MessageBoxImage.None;
     this.options = MessageBoxOptions.None;
     this.defaultResult = MessageBoxResult.Cancel;
 }
开发者ID:garuma,项目名称:xwt,代码行数:7,代码来源:AlertDialogBackend.cs

示例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);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:14,代码来源:RTLAwareMessageBox.cs

示例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();
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:27,代码来源:KryptonMessageBox.cs

示例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;
        }
开发者ID:suvjunmd,项目名称:Windows-10-Login-Background-Changer,代码行数:30,代码来源:WPFMessageBoxWindow.xaml.cs

示例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);
 }
开发者ID:jwillj2k4,项目名称:TCPServer,代码行数:21,代码来源:TcpMessageService.cs

示例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);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:14,代码来源:MessageBoxStub.cs

示例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);
 }
开发者ID:fikalefaza,项目名称:openvpn-manager,代码行数:8,代码来源:RTLMessageBox.cs

示例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;
        }
开发者ID:Powerino73,项目名称:paradox,代码行数:14,代码来源:DialogEventArgs.cs

示例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 );
 }
开发者ID:Glain,项目名称:FFTPatcher,代码行数:10,代码来源:MyMessageBox.cs

示例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);
        }
开发者ID:psyCHOder,项目名称:conferencexp,代码行数:10,代码来源:RtlAwareMessageBox.cs

示例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);
 }
开发者ID:rioka,项目名称:Rothko,代码行数:11,代码来源:DialogFacade.cs

示例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);
        }
开发者ID:CrazyBBer,项目名称:Caliburn.Micro.Learn,代码行数:12,代码来源:DialogConductorViewModel.cs

示例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);
 }
开发者ID:rexperalta,项目名称:OCTGN,代码行数:12,代码来源:TopMostMessageBox.cs


注:本文中的MessageBoxOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。