本文整理汇总了C#中IWindowManager.ShowMessageBox方法的典型用法代码示例。如果您正苦于以下问题:C# IWindowManager.ShowMessageBox方法的具体用法?C# IWindowManager.ShowMessageBox怎么用?C# IWindowManager.ShowMessageBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWindowManager
的用法示例。
在下文中一共展示了IWindowManager.ShowMessageBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartWithErrorDialogAsync
public static async Task StartWithErrorDialogAsync(this ISyncthingManager syncthingManager, IWindowManager windowManager)
{
try
{
await syncthingManager.StartAsync();
}
catch (Win32Exception e)
{
if (e.ErrorCode != -2147467259)
throw;
// Possibly "This program is blocked by group policy. For more information, contact your system administrator" caused
// by e.g. CryptoLocker?
windowManager.ShowMessageBox(
Localizer.F(Resources.Dialog_SyncthingBlockedByGroupPolicy_Message, e.Message, syncthingManager.ExecutablePath),
Resources.Dialog_SyncthingBlockedByGroupPolicy_Title,
MessageBoxButton.OK, icon: MessageBoxImage.Error);
}
catch (SyncthingDidNotStartCorrectlyException e)
{
windowManager.ShowMessageBox(
Localizer.F(Resources.Dialog_SyncthingDidNotStart_Message, e.Message),
Resources.Dialog_SyncthingDidNotStart_Title,
MessageBoxButton.OK, icon: MessageBoxImage.Error);
}
}