using System.Threading.Tasks;
//保存污染因子
private void btSavePF_Click(object sender, EventArgs e)
{
try
{
Task task = Task.Factory.StartNew(() =>
{
SavaPollutionFactor(); // 耗时运算
});
Task UITask = task.ContinueWith(t =>
{
btSavePF.Enabled = true;
picLoading.Visible = false;
}, TaskScheduler.FromCurrentSynchronizationContext());
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
//保存因子具体方法
private void SavaPollutionFactor()
{
try
{
}
catch (Exception ex)
{
}
}