using DevExpress.XtraSplashScreen;
using System;
namespace DevExpressUtilHelpV3
{
/// <summary>
/// 基于.NET 3.0的 SplashScreen工具类
/// </summary>
public static class SplashScreenToolV3
{
private const bool FadeIn = false;
private const bool FadeOut = true;
private const bool ThrowExceptionIfIsAlreadyShown = false;
private const bool ThrowExceptionIfIsAlreadyClosed = false;
/// <summary>
/// ShowSplashScreen
/// </summary>
/// <param name="type">WaitForm</param>
public static void ShowSplashScreen(Type type)
{
CloseSplashScreen();
SplashScreenManager.ShowForm(null, type, FadeIn, FadeOut, ThrowExceptionIfIsAlreadyShown);
}
/// <summary>
/// CloseSplashScreen
/// </summary>
public static void CloseSplashScreen()
{
if (SplashScreenManager.Default != null)
{
//Thread _task = new Thread(() =>
//{
SplashScreenManager.CloseForm(ThrowExceptionIfIsAlreadyClosed);
//});
//_task.Start();
}
}
/// <summary>
/// SetCaption
/// </summary>
/// <param name="caption">需要设置的Title</param>
public static void SetCaption(string caption)
{
if (SplashScreenManager.Default != null && !string.IsNullOrEmpty(caption))
{
SplashScreenManager.Default.SetWaitFormCaption(caption);
}
}
/// <summary>
/// SetDescription
/// </summary>
/// <param name="description">需要设置的文字提示信息</param>
public static void SetDescription(string description)
{
if (SplashScreenManager.Default != null && !string.IsNullOrEmpty(description))
{
SplashScreenManager.Default.SetWaitFormDescription(description);
}
}
}
}
try
{
SplashScreenToolV3.ShowSplashScreen(typeof(WaitForm1));
Thread.Sleep(5000);
throw new Exception("ccccccccc");
////Thread.Sleep(5000);
//SplashScreenToolV3.SetCaption("正在开始下载....");
////SplashScreenController.ShowSplashScreen();
//Thread _task1 = new Thread(() =>
//{
// for (int i = 0; i < 100; i++)
// {
// SplashScreenToolV3.SetDescription(i.ToString() + "%");
// Thread.Sleep(1000);
// }
//});
//Thread _task2 = new Thread(() =>
//{
// for (int i = 0; i < 100; i++)
// {
// SplashScreenToolV3.SetCaption("测试.." + i);
// Thread.Sleep(500);
// }
//});
//_task1.Start();
//_task2.Start();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
// SplashScreenController.HideSplashScreen();
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有