private void lvDataView_DoubleClick(object sender, EventArgs e) { if (lvDataView.SelectedItems.Count > 0) { CadPaper.Open(lvDataView.SelectedItems[0].SubItems[(int)DataViewColumn.文件路径].Text); } }
private void UpdateUI(object invokeArgs) { CadPaperProgressEventArgs args = (CadPaperProgressEventArgs)invokeArgs; CadPaper paper = args.CurrentPaper; switch (args.SenderMethod) { case CadPaperProgressSender.筛选: { ListViewItem item = lvDataView.Items[args.CurrentPoint - 1]; if (item.SubItems[(int)DataViewColumn.文件名].Text == paper.FileShortName) { item.SubItems[(int)DataViewColumn.图幅].Text = paper.MapSheet; item.SubItems[(int)DataViewColumn.已打印].Text = paper.PrintedNum.ToString(CultureInfo.InvariantCulture); item.SubItems[(int)DataViewColumn.角度].Text = paper.Angle.ToString(CultureInfo.InvariantCulture); item.SubItems[(int)DataViewColumn.比例].Text = paper.Scale.ToString(CultureInfo.InvariantCulture); item.SubItems[(int)DataViewColumn.宽度].Text = paper.Width.ToString(CultureInfo.InvariantCulture); item.SubItems[(int)DataViewColumn.高度].Text = paper.Height.ToString(CultureInfo.InvariantCulture); item.SubItems[(int)DataViewColumn.打印机].Text = paper.PlotConfigName; item.SubItems[(int)DataViewColumn.打印尺寸].Text = paper.CanonicalMediaName; item.SubItems[(int)DataViewColumn.打印样式].Text = paper.StyleSheet; } break; } case CadPaperProgressSender.打印: { ListViewItem item = lvDataView.Items[args.CurrentPoint - 1]; if (item.SubItems[(int)DataViewColumn.文件名].Text == paper.FileShortName) { item.SubItems[(int)DataViewColumn.是否已打印].Text = string.Format("{0}{1}", "*", item.SubItems[0].Text); item.SubItems[(int)DataViewColumn.已打印].Text = paper.PrintedNum.ToString(CultureInfo.InvariantCulture); } break; } case CadPaperProgressSender.筛选完成: { CompleteScreen(); break; } case CadPaperProgressSender.打印完成: { _isBusy = false; break; } case CadPaperProgressSender.运行错误: { _isBusy = false; break; } } if (args.CurrentPoint < args.Count) { toolStripProgressBar1.Visible = true; toolStripProgressBar1.Maximum = args.Count; toolStripProgressBar1.Value = args.CurrentPoint; } else { toolStripProgressBar1.Visible = false; } }