namespace Yw.WinFrmUI
|
{
|
/// <summary>
|
/// 用于右下角弹窗提示
|
/// </summary>
|
public static class AlertToolHelper
|
{
|
//
|
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>
|
/// <param name="owner"></param>
|
/// <param name="caption"></param>
|
/// <param name="text"></param>
|
public static void ShowAlertInfo(this Form owner, string caption, string text)
|
{
|
AlertInfo info = new(caption, text);
|
Alert.Show(owner, info);
|
}
|
|
|
}
|
}
|