WaitingFormHelper
using Lba_Ciac;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace Lbb.Cx.Ciac.Utility
{
public class WaitingFormHelper
{
private Loading waitingForm = null; private Action _method = null; private WaitingFormHelper(Action method, string message)
{
this._method = method;
this.waitingForm = new Loading();
this.waitingForm.Text = message;
this.waitingForm.StartPosition = FormStartPosition.CenterParent;
this.waitingForm.Shown += new EventHandler(this.waitingForm_Shown);
}
public static void ShowWaitingForm(Action method, string message)
{
WaitingFormHelper waitingFormHelper = new WaitingFormHelper(method, message);
waitingFormHelper.waitingForm.ShowDialog();
} private void waitingForm_Shown(object sender, EventArgs e)
{
try
{
this._method.BeginInvoke(new AsyncCallback(this.callBack), null);
}
catch (System.ObjectDisposedException)
{
return;//如果主界面已经退出了,那线程也退出好了。
}
} private void callBack(IAsyncResult ar)
{
if (this.waitingForm != null && !this.waitingForm.IsDisposed)
{
this.waitingForm.Invoke(new Action(delegate
{
this.waitingForm.Close();
}));
}
}
}
}
WaitingFormHelper的更多相关文章
随机推荐
- window下安装cross-env解决NODE_ENV ts-node 不是内部或外部命令,也不是可运行的程序 或批处理文件 问题
window下安装cross-env解决NODE_ENV ts-node 不是内部或外部命令,也不是可运行的程序 或批处理文件 问题 在git bash上启动无法进行调试,采用cross-env后可以 ...
- tomcat9 性能调优
官网最靠谱 tomcat 参数官网: http://tomcat.apache.org/tomcat-7.0-doc/config/http.html <Connector port=& ...
- AtCoder Beginner Contest 045 C - たくさんの数式 / Many Formulas
Time limit : 2sec / Memory limit : 256MB Score : 300 points Problem Statement You are given a string ...
- AtCoder Beginner Contest 045 B - 3人でカードゲームイージー / Card Game for Three (ABC Edit)
Time limit : 2sec / Memory limit : 256MB Score : 200 points Problem Statement Alice, Bob and Charlie ...
- 关于mapreducer 读取hbase数据 存入mysql的实现过程
mapreducer编程模型是一种八股文的代码逻辑,就以用户行为分析求流存率的作为例子 1.map端来说:必须继承hadoop规定好的mapper类:在读取hbase数据时,已经有现成的接口 Tabl ...
- 利用webpack手动构建vue工程
一 创建一个文件夹,在文件夹中打开命令行执行:$npm install 创建一个package文件 ,可以先忽略作者等信息: 二 安装webpack依赖包(根据需要安装) //全局安装 ...
- php+js 防止被抓包篡改数据,数据签名校验
签名密钥,这个是自己生成的,需要客户端+服务端一致. <?php /** * 获取签名 * @param $data 提交的数据 * @param $key 安全密钥 * @return boo ...
- bzoj3932 / P3168 [CQOI2015]任务查询系统(主席树+差分)
P3168 [CQOI2015]任务查询系统 看到第k小,就是主席树辣 对于每一段任务(a,b,k),在版本a的主席树+k,版本b+1的主席树-k 同一时间可能有多次修改,所以开个vector存操作, ...
- 关于__declspec(dllexport)
windows下dll动态库函数的导入与导出. __declspec Microsoft Specific __declspec ( extended-attribute ) declarator l ...
- MVC HTML页面使用
解决HTML <system.webServer> <validation validateIntegratedModeConfiguration="false" ...