private void CMSRunToolStripMenuItem_Click(object sender, EventArgs e) { var s = sender as ToolStripMenuItem; var directory = treeViewDirs.SelectedNode.Tag as DirectoryInfo; var rows = new List <DataGridViewRow>(); foreach (DataGridViewCell cell in dataGridViewRun.SelectedCells) { if (!rows.Contains(dataGridViewRun.Rows[cell.RowIndex])) { rows.Add(dataGridViewRun.Rows[cell.RowIndex]); } } if (s == radialogicaToolStripMenuItem && rows.Count > 2) { if (MessageBox.Show("You have selected more than two patients. Radialogica is unstable and/or takes a " + "long time when opening multiple packages. Hit OK to continue, otherwise Cancel", "Many Packages selected!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) != DialogResult.OK) { return; } } foreach (DataGridViewRow row in rows) { ReviewPatient reviewPatient = _data[directory].Collection.Find(x => x.Guid == Guid.Parse(row.Cells["GUID"].Value.ToString())); try { if (s == pDFToolStripMenuItem && reviewPatient.FilePDF.Exists) { _processManager?.Add(new ReviewProcess(reviewPatient.FilePDF.FullName) { ProcessType = ProcessType.PDF }); } if (s == radialogicaToolStripMenuItem && reviewPatient.FileRadialogica.Exists) { _processManager?.Add(new ReviewProcess(reviewPatient.FileRadialogica.FullName) { ProcessType = ProcessType.Radialogica }); } } catch (System.ComponentModel.Win32Exception ex) { MessageBox.Show($"I did not find one of the files!\n'{ex.Message}'", @"File Not Found!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void DataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) { return; } var s = sender as DataGridView; var directory = treeViewDirs.SelectedNode.Tag as DirectoryInfo; var row = s.Rows[e.RowIndex].Cells; ReviewPatient reviewPatient = _data[directory].Collection.Find(x => x.Guid == Guid.Parse(row["GUID"].Value.ToString())); _childProcesses.Add(System.Diagnostics.Process.Start(reviewPatient.FilePDF.FullName)); }
private void ButtonRun_Click(object sender, EventArgs e) { var s = sender as Button; var directory = treeViewDirs.SelectedNode.Tag as DirectoryInfo; if (s == buttonRunSelectAll) { dataGridViewRun.SelectAll(); return; } var patients = new List <ReviewPatient>(); var rows = new List <DataGridViewRow>(); foreach (DataGridViewCell cell in dataGridViewRun.SelectedCells) { ReviewPatient reviewPatient = _data[directory].Collection.Find(x => x.Guid == Guid.Parse(cell.OwningRow.Cells["GUID"].Value.ToString())); if (!patients.Contains(reviewPatient)) { patients.Add(reviewPatient); } } if (s == buttonRunRadialogica && patients.Count > 2) { if (MessageBox.Show("You have selected more than two patients. Radialogica is unstable and/or takes a " + "long time when opening multiple packages. Hit OK to continue, otherwise Cancel", "Many Packages selected!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) != DialogResult.OK) { return; } } foreach (var patient in patients) { if (s == buttonRunPDF) { _processManager.Add(new ReviewProcess(patient.FilePDF.FullName, ProcessType.PDF)); } else if (s == buttonRunRadialogica) { _processManager.Add(new ReviewProcess(patient.FileRadialogica.FullName, ProcessType.Radialogica)); } } }