namespace Yw.WinFrmUI
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public static class VmoExceptionAlertHelper
|
{
|
private static AlertControl Alert
|
{
|
get
|
{
|
if (_alert == null)
|
{
|
lock (_locker)
|
{
|
if (_alert == null)
|
{
|
_alert = new AlertControl();
|
_alert.AutoFormDelay = 3000;
|
_alert.AutoHeight = false;
|
_alert.FormMaxCount = 1;
|
}
|
}
|
}
|
return _alert;
|
}
|
}
|
private static AlertControl _alert = null;
|
private static object _locker = new();
|
|
/// <summary>
|
/// 显示右下角弹窗
|
/// </summary>
|
public static void ShowAlertInfo(this Form owner, Yw.Vmo.VException ex)
|
{
|
var info = new AlertInfo(ex.ErrorCode, ex.ErrorMsg, HttpStatusImageHelper.ImgC.Images[ex.ErrorStatus]);
|
Alert.Show(owner, info);
|
}
|
|
/// <summary>
|
/// 显示右下角弹窗
|
/// </summary>
|
public static void ShowAlertInfo(this Control owner, Yw.Vmo.VException ex)
|
{
|
var form = owner.FindForm();
|
form.ShowAlertInfo(ex);
|
}
|
|
|
}
|
}
|