using System;
using LibationWinForms.Dialogs;
namespace LibationWinForms
{
public static class MessageBoxAlertAdmin
{
///
/// Logs error. Displays a message box dialog with specified text and caption.
///
/// The text to display in the message box.
/// The text to display in the title bar of the message box.
/// Exception to log
/// One of the System.Windows.Forms.DialogResult values.
public static System.Windows.Forms.DialogResult Show(string text, string caption, Exception exception)
{
try
{
Serilog.Log.Logger.Error(exception, "Alert admin error: {@DebugText}", new { text, caption });
}
catch { }
using var form = new MessageBoxAlertAdminDialog(text, caption, exception);
return form.ShowDialog();
}
}
}