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


C# MessageBox.ShowInternal方法代码示例

本文整理汇总了C#中MessageBox.ShowInternal方法的典型用法代码示例。如果您正苦于以下问题:C# MessageBox.ShowInternal方法的具体用法?C# MessageBox.ShowInternal怎么用?C# MessageBox.ShowInternal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessageBox的用法示例。


在下文中一共展示了MessageBox.ShowInternal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Show

 /// <summary>
 /// Displays a <see cref="MessageBox"/> an returns the <see cref="MessageBoxResult"/> depending on the user's choice.
 /// </summary>
 /// <param name="owner">A <see cref="Window"/> that represents the owner window of the message box.</param>
 /// <param name="message">A <see cref="string"/> that specifies the text to display.</param>
 /// <param name="caption">A <see cref="string"/> that specifies the title bar caption to display.</param>
 /// <param name="buttons">A n enumeration of <see cref="DialogButtonInfo"/> that specifies buttons to display</param>
 /// <param name="image">A <see cref="MessageBoxImage"/> value that specifies the icon to display.</param>
 /// <returns>A <see cref="MessageBoxResult"/> value that specifies which message box button is clicked by the user.</returns>
 public static MessageBoxResult Show(Window owner, string message, string caption, IEnumerable<DialogButtonInfo> buttons, MessageBoxImage image)
 {
     var messageBox = new MessageBox
     {
         Owner = owner,
         WindowStartupLocation = owner != null ? WindowStartupLocation.CenterOwner : WindowStartupLocation.CenterScreen,
         Title = caption,
         Content = message,
         ButtonsSource = buttons.ToList(),
     };
     SetImage(messageBox, image);
     return (MessageBoxResult)messageBox.ShowInternal();
 }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:22,代码来源:MessageBox.cs

示例2: Show

 /// <summary>
 /// Displays a <see cref="MessageBox"/> an returns the <see cref="MessageBoxResult"/> depending on the user's choice.
 /// </summary>
 /// <param name="owner">The intended owner window of the message box.</param>
 /// <param name="message">A <see cref="string"/> that specifies the text to display.</param>
 /// <param name="caption">A <see cref="string"/> that specifies the title bar caption to display.</param>
 /// <param name="buttons">A n enumeration of <see cref="DialogButtonInfo"/> that specifies buttons to display</param>
 /// <param name="image">A <see cref="MessageBoxImage"/> value that specifies the icon to display.</param>
 /// <returns>A <see cref="MessageBoxResult"/> value that specifies which message box button is clicked by the user.</returns>
 public static async Task<MessageBoxResult> Show(WindowOwner owner, string message, string caption, IEnumerable<DialogButtonInfo> buttons, MessageBoxImage image)
 {
     var buttonList = buttons.ToList();
     var messageBox = new MessageBox
     {
         Title = caption,
         Content = message,
         ButtonsSource = buttonList,
     };
     SetImage(messageBox, image);
     SetKeyBindings(messageBox, buttonList);
     return (MessageBoxResult)await messageBox.ShowInternal(owner);
 }
开发者ID:Kryptos-FR,项目名称:xenko-reloaded,代码行数:22,代码来源:MessageBox.cs


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