程序运行死锁时,每隔一定时间间隔刷新UI进度
DateTime tipDTPrevious = DateTime.Now;
DateTime tipDTNow = DateTime.Now;
void helper_ProgressEvent(string Tips, int CurrentVal, int MaxVal)
{
tipDTNow = DateTime.Now;
if ((tipDTNow - tipDTPrevious).TotalSeconds > 3)
{
int iLength = Encoding.GetEncoding(936).GetBytes(Tips).Length;
WaitManager.Show(Tips, new Size((iLength + 4) * 9, 71));//string.Format("正在导出数据 {0}%", (CurrentVal / MaxVal) * 100)
tipDTPrevious = tipDTNow;
}
}