• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MessageBoxOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MessageBoxOptions的典型用法代码示例。如果您正苦于以下问题:C# MessageBoxOptions类的具体用法?C# MessageBoxOptions怎么用?C# MessageBoxOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MessageBoxOptions类属于命名空间,在下文中一共展示了MessageBoxOptions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Show

		public void Show(string title, string message, MessageBoxTypes type, MessageBoxOptions options, MessageBoxCallback callback)
		{
			if (type == MessageBoxTypes.Ok)
			{
				EditorUtility.DisplayDialog(title, message, options.OkButtonName);
				if (callback != null) callback(MessageBoxResult.Ok);
			}
			else
			{
				bool value = EditorUtility.DisplayDialog(title, message, options.OkButtonName, options.CancelButtonText);
				if (callback != null) callback(value ? MessageBoxResult.Ok : MessageBoxResult.Cancel);
			}
		}
开发者ID:lPinchol,项目名称:Reign-Unity-Plugin,代码行数:13,代码来源:MessageBoxPlugin.cs


示例17: showAsync

		private async void showAsync(string title, string message, MessageBoxTypes type, MessageBoxOptions options, MessageBoxCallback callback)
		#endif
		{
			#if WINDOWS_PHONE
			WinRTPlugin.Dispatcher.BeginInvoke(delegate()
			{
				// XNA method
				Microsoft.Xna.Framework.GamerServices.Guide.BeginShowMessageBox(title, message,
				new System.Collections.Generic.List<string> {options.OkButtonName, options.CancelButtonText}, 0, Microsoft.Xna.Framework.GamerServices.MessageBoxIcon.Error,
				asyncResult =>
				{
					int? result = Microsoft.Xna.Framework.GamerServices.Guide.EndShowMessageBox(asyncResult);
					ReignServices.InvokeOnUnityThread(delegate
					{
						if (callback != null) callback(result == 0 ? MessageBoxResult.Ok : MessageBoxResult.Cancel);
					});
				}, null);

				// Silverlight method. (Doesn't support custom named buttons)
				//var result = MessageBox.Show(message, title, type == MessageBoxTypes.Ok ? MessageBoxButton.OK : MessageBoxButton.OKCancel);
				//if (callback != null) callback(result == System.Windows.MessageBoxResult.OK ? MessageBoxResult.Ok : MessageBoxResult.Cancel);
			});
			#else
			await WinRTPlugin.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async delegate()
			{
				var msg = new MessageDialog(message, title);
				if (type == MessageBoxTypes.Ok)
				{
					await msg.ShowAsync();
					ReignServices.InvokeOnUnityThread(delegate
					{
						if (callback != null) callback(MessageBoxResult.Ok);
					});
				}
				else if (type == MessageBoxTypes.OkCancel)
				{
					bool result = false;
					msg.Commands.Add(new UICommand(options.OkButtonName, new UICommandInvokedHandler((cmd) => result = true)));
					msg.Commands.Add(new UICommand(options.CancelButtonText, new UICommandInvokedHandler((cmd) => result = false)));
					await msg.ShowAsync();
					ReignServices.InvokeOnUnityThread(delegate
					{
						if (callback != null) callback(result ? MessageBoxResult.Ok : MessageBoxResult.Cancel);
					});
				}
			});
			#endif
		}
开发者ID:lPinchol,项目名称:Reign-Unity-Plugin,代码行数:48,代码来源:MessageBoxPlugin.cs


示例18: ShowMessageBox

		/// <summary>
		/// Display a MessageBox
		/// </summary>
		/// <param name="messageBoxText">A System.String that specifies the text to display.</param>
		/// <param name="caption">A System.String that specifies the title bar caption to display.</param>
		/// <param name="buttons">A System.Windows.MessageBoxButton value that specifies which button or buttons to display.</param>
		/// <param name="icon">A System.Windows.MessageBoxImage value that specifies the icon to display.</param>
		/// <param name="defaultResult">A System.Windows.MessageBoxResult value that specifies the default result of the message box.</param>
		/// <param name="cancelResult">A System.Windows.MessageBoxResult value that specifies the cancel result of the message box</param>
		/// <param name="options">A System.Windows.MessageBoxOptions value object that specifies the options.</param>
		/// <param name="buttonLabels">A dictionary specifying the button labels, if desirable</param>
		/// <returns>The result chosen by the user</returns>
		public MessageBoxResult ShowMessageBox(string messageBoxText, string caption = "",
				MessageBoxButton buttons = MessageBoxButton.OK,
				MessageBoxImage icon = MessageBoxImage.None,
				MessageBoxResult defaultResult = MessageBoxResult.None,
				MessageBoxResult cancelResult = MessageBoxResult.None,
				MessageBoxOptions options = MessageBoxOptions.None,
				IDictionary<MessageBoxResult, string> buttonLabels = null)
		{
			var vm = messageBoxViewModelFactory();
			vm.Setup(messageBoxText, caption, buttons, icon, defaultResult, cancelResult, options, buttonLabels);
			// Don't go through the IoC container to get the View. This means we can simplify it...
			var messageBoxView = new MessageBoxView();
			messageBoxView.InitializeComponent();
			viewManager.BindViewToModel(messageBoxView, vm);
			ShowDialog(vm);
			return vm.ClickedButton;
		}
开发者ID:SixtenLabs,项目名称:Gluten,代码行数:29,代码来源:WindowManager.cs


示例19: MessageBoxViewModel

        public MessageBoxViewModel(
            WpfMessageBoxWindow view,
            string title,
            string message,
            MessageBoxButton buttonOption,
            MessageBoxImage image,
            MessageBoxResult defaultResult,
            MessageBoxOptions options)
        {
            //TextAlignment
            Title = title;
            Message = message;
            ButtonOption = buttonOption;
            Options = options;

            SetDirections(options);
            SetButtonVisibility(buttonOption);
            SetImageSource(image);
            SetButtonDefault(defaultResult);
            _view = view;
        }
开发者ID:suvjunmd,项目名称:Windows-10-Login-Background-Changer,代码行数:21,代码来源:MessageBoxViewModel.cs


示例20: WithOptions

 public MyMessageBox WithOptions(MessageBoxOptions options)
 {
     this._Options = options;
     return this;
 }
开发者ID:spitfire1337,项目名称:Borderlands-2-Save-Editor,代码行数:5,代码来源:MyMessageBox.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MessageBoxResult类代码示例发布时间:2022-05-24
下一篇:
C# MessageBoxImage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap