private void btnSchmidtAnalys_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.ActiveDataForm != null && !this.ActiveDataForm.IsBusy) { var targetform = this.ActiveDataForm; var targettable = targetform.GetDataTable(); ConfigForm.SchmidtAnalysisConfigForm configform = new ConfigForm.SchmidtAnalysisConfigForm(targettable.Name, targettable.GetColumnsList(false, typeof(string), typeof(DateTime), typeof(bool))); if (configform.ShowDialog() == DialogResult.OK) { try { MdiForm.MdiDataViewForm resultform = new MdiForm.MdiDataViewForm(); Protocol.Structure.WaitObject wt = new Protocol.Structure.WaitObject(); targetform.DoMethod("施密特分析", (ThreadPool) => { var result = Kernel.BusinessLogicOperation.DataProcessOperation.SchmidtAnalysis(targettable, configform.SelectedColumns, configform.AreaSize, configform.AreaSpace); if (result.Item1 != Kernel.BusinessLogicOperation.DataProcessOperation.RESULTCODE.SUCCESS) { string errormsg = "程序发生错误"; switch (result.Item1) { case Kernel.BusinessLogicOperation.DataProcessOperation.RESULTCODE.OUTOFRANGE: { errormsg = "滑动区间超过数据范围"; break; } } MessageBox.Show(errormsg); resultform.AbortMethod(); } else { resultform.DataSource = result.Item2; } }, wt, () => { this.Invoke(new Action(() => { resultform.MdiParent = this; resultform.MdiIndex = this.DataFormIndex++; resultform.Caption = targetform.Caption + "_施密特分析结果"; resultform.Show(); })); }); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }
private void btnSchmidtAnalys_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.ActiveDataForm != null && !this.ActiveDataForm.IsBusy) { var targetform = this.ActiveDataForm; var targettable = targetform.GetDataTable(); ConfigForm.SchmidtAnalysisConfigForm configform = new ConfigForm.SchmidtAnalysisConfigForm(targettable.Name, targettable.GetColumnsList(false, typeof(string), typeof(DateTime), typeof(bool))); if (configform.ShowDialog() == DialogResult.OK) { try { MdiForm.MdiDataViewForm resultform = new MdiForm.MdiDataViewForm(); Protocol.Structure.WaitObject wt = new Protocol.Structure.WaitObject(); targetform.DoMethod("施密特分析", (ThreadPool) => { var result = Kernel.BusinessLogicOperation.DataProcessOperation.SchmidtAnalysis(targettable, configform.SelectedColumns, configform.AreaSize, configform.AreaSpace); if(result.Item1 != Kernel.BusinessLogicOperation.DataProcessOperation.RESULTCODE.SUCCESS) { string errormsg = "程序发生错误"; switch(result.Item1) { case Kernel.BusinessLogicOperation.DataProcessOperation.RESULTCODE.OUTOFRANGE: { errormsg = "滑动区间超过数据范围"; break; } } MessageBox.Show(errormsg); resultform.AbortMethod(); } else { resultform.DataSource = result.Item2; } }, wt, () => { this.Invoke(new Action(() => { resultform.MdiParent = this; resultform.MdiIndex = this.DataFormIndex++; resultform.Caption = targetform.Caption + "_施密特分析结果"; resultform.Show(); })); }); } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }