/****************************** * 说明:管理等待窗口类 * 创建人:龚宇超 * 创建日期:2017-08-08 * 修改人: * 修改日期: * 修改备注: * 版本:1.0.0.0 ******************************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using DevExpress.XtraSplashScreen; using Lskj.Business.Impl; using Lskj.Data; namespace Lskj.Control.Model { public static class WaitForm { private static string _dataMsg; private static SplashScreenManager _loadForm; /// /// 等待窗口对象 /// public static SplashScreenManager LoadForm { get { if (_loadForm == null) { SplashFormProperties properties = new SplashFormProperties(); _loadForm = new SplashScreenManager(typeof(FrmWait), properties); } return _loadForm; } } /// /// 说明:显示等待窗体 /// 创建人:龚宇超 /// 创建日期:2017-08-12 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// 默认为数据加载中... public static void ShowForm(string msg = null) { _dataMsg = msg ?? ResourceKeys.DataLoading; if (LanguageTranslation.Translatable) _dataMsg = LanguageTranslation.GetTranslatedText(_dataMsg); bool flag = !LoadForm.IsSplashFormVisible; if (flag) { _loadForm.ShowWaitForm(); _loadForm.SetWaitFormCaption(_dataMsg); } else { _loadForm.SetWaitFormCaption(_dataMsg); } } /// /// 说明:关闭等待窗体 /// 创建人:龚宇超 /// 创建日期:2017-08-11 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// public static void HideForm() { bool isSplashFormVisible = LoadForm.IsSplashFormVisible; if (isSplashFormVisible) { _loadForm.CloseWaitForm(); } } } }