public partial class ProgressForm : BaseForm
{
public Action<ProgressForm> ClosedClick;
public ProgressForm()
{
InitializeComponent();
}
public void IniFailed(Exception ex = null)
{
if (this.InvokeRequired)
{
this.BeginInvoke(new ESBasic.CbGeneric<Exception>(this.IniFailed),ex);
}
else
{
if (ex != null)
{
CommonGlobalUtil.WriteLog(ex);
GlobalMessageBox.Show(ex.Message, "失败");
}
this.UseWaitCursor = false;
this.DialogResult = DialogResult.Abort;
}
}
public void IniCompleted()
{
if (this.InvokeRequired)
{
this.BeginInvoke(new ESBasic.CbGeneric(this.IniCompleted));
}
else
{
this.progressBar1.Value = this.progressBar1.Maximum;
this.DialogResult = DialogResult.OK;
this.UseWaitCursor = false;
}
}