private void mnImport_Click(object sender, EventArgs e) { if (this.openImpDialog.ShowDialog() != DialogResult.Cancel) { FrmWaiting wait = new FrmWaiting(); wait.BeginOperate(this, new FrmWaiting.OperationDelegate(delegate { CParser parser = new CParser(this.openImpDialog.FileName); //parser.lcDbLocation = this.lcDbLocation; parser.parseMLB(); parser.parseFLR(); })); /* * OLD CODE * frmProgress progress = new frmProgress(); * string[] strArray = File.ReadAllLines(this.openImpDialog.FileName); * progress.progressBar.Maximum = strArray.Length; * parser.tfrmProgress = progress; * progress.Show(); * if (parser.checkDB()) * { * parser.parseMLB(); * parser.parseFLR(); * } * progress.Hide(); */ } }
private void btnImport_Click(object sender, EventArgs e) { if (this.openImpDialog.ShowDialog(this) != DialogResult.Cancel) { FrmWaiting wait = new FrmWaiting(); wait.BeginOperate(this, new FrmWaiting.OperationDelegate(delegate { CParser parser = new CParser(this.openImpDialog.FileName); parser.WaitingForm = wait; parser.WaitingMethod += delegate(string text) { wait.WaitingText = text; }; //parser.lcDbLocation = this.lcDbLocation; parser.parseMLB(); parser.parseFLR(); GC.Collect(); })); } }
private void mnImport_Click(object sender, EventArgs e) { if (this.openImpDialog.ShowDialog() != DialogResult.Cancel) { FrmWaiting wait = new FrmWaiting(); wait.BeginOperate(this, new FrmWaiting.OperationDelegate(delegate { CParser parser = new CParser(this.openImpDialog.FileName); //parser.lcDbLocation = this.lcDbLocation; parser.parseMLB(); parser.parseFLR(); })); /* * OLD CODE frmProgress progress = new frmProgress(); string[] strArray = File.ReadAllLines(this.openImpDialog.FileName); progress.progressBar.Maximum = strArray.Length; parser.tfrmProgress = progress; progress.Show(); if (parser.checkDB()) { parser.parseMLB(); parser.parseFLR(); } progress.Hide(); */ } }