34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
using Avalonia.Controls;
|
||
using DTLib.Ben.Demystifier;
|
||
using MsBox.Avalonia;
|
||
using MsBox.Avalonia.Dto;
|
||
using MsBox.Avalonia.Models;
|
||
|
||
namespace Млаумчерб.Клиент;
|
||
|
||
public static class Ошибки
|
||
{
|
||
internal static void ПоказатьСообщение(Exception err)
|
||
=> ПоказатьСообщение(err.ToStringDemystified());
|
||
|
||
internal static async void ПоказатьСообщение(string err)
|
||
{
|
||
var box = MessageBoxManager.GetMessageBoxCustom(new MessageBoxCustomParams
|
||
{
|
||
ButtonDefinitions = new List<ButtonDefinition> { new() { Name = "пон" } },
|
||
ContentTitle = "ОШИБКА",
|
||
ContentMessage = err,
|
||
Icon = MsBox.Avalonia.Enums.Icon.Error,
|
||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||
CanResize = true,
|
||
MaxWidth = 1000,
|
||
MaxHeight = 1000,
|
||
SizeToContent = SizeToContent.WidthAndHeight,
|
||
ShowInCenter = true,
|
||
Topmost = true
|
||
}
|
||
);
|
||
//TODO: write to log
|
||
await box.ShowAsync().ConfigureAwait(false);
|
||
}
|
||
} |