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