private void Download(FileListItem selectedFile, string selectedDicomPackageLocalPath, 云数据类型Enum 云数据类型Enum) { DownloadFileWorker.Download( selectedFile, selectedDicomPackageLocalPath, delegate(string filename) { UIUtil.Invoke(this, delegate { System.Diagnostics.Process.Start(selectedDicomPackageLocalPath); }); }, delegate(string errMsg) { UIUtil.Invoke(this, delegate { MessageBox.Show(errMsg); }); }, delegate(Exception ex) { UIUtil.Invoke(this, delegate { //Util.ShowExceptionMessage(ex); Download(selectedFile, selectedDicomPackageLocalPath, 云数据类型Enum.处理结果); }); }, delegate(ProgressArgs progressArgs) { UIUtil.Invoke(this, delegate { Console.WriteLine(progressArgs); }); }, 云数据类型Enum); }
private void DownloadDicom(FileListItem selectedFile, DataListItem dataListItem, string selectedDicomPackageLocalPath, 云数据类型Enum 云数据类型Enum) { DownloadFileWorker.Download( selectedFile, selectedDicomPackageLocalPath, delegate(string filename) { UIUtil.Invoke(this, delegate { try { //string tempPath = selectedDicomPackageLocalPath.Substring(0, selectedDicomPackageLocalPath.LastIndexOf(Path.DirectorySeparatorChar)); //System.Diagnostics.Process.Start(tempPath); //ResumeGUI(); while (!File.Exists(selectedDicomPackageLocalPath)) { } string destFileRAR = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(selectedDicomPackageLocalPath), System.IO.Path.GetFileNameWithoutExtension(selectedDicomPackageLocalPath) + ".zip"); File.Copy(selectedDicomPackageLocalPath, destFileRAR); File.Delete(selectedDicomPackageLocalPath); selectedDicomPackageLocalPath = destFileRAR; //System.Diagnostics.Process.Start(System.IO.Path.GetDirectoryName(selectedDicomPackageLocalPath)); string destFolder = AirwayPatients.BaseDicomFolder + "\\" + dataListItem.PatientName + "_" + dataListItem.StudyInstanceUID; //解压缩并用dicomviewer打开 FileDAO.upZip(selectedDicomPackageLocalPath, destFolder); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }); }, delegate(string errMsg) { UIUtil.Invoke(this, delegate { MessageBox.Show("下载发生异常!", "提示"); }); }, delegate(Exception ex) { UIUtil.Invoke(this, delegate { Util.ShowExceptionMessage(ex); }); }, delegate(ProgressArgs progressArgs) { UIUtil.Invoke(this, delegate { Console.WriteLine(progressArgs.Percentage.Value); Progress.Value = progressArgs.Percentage.Value; tbPercent.Text = ((progressArgs.Percentage.Value * 100).ToString("F2")).ToString() + " %"; txtFileSize.Text = FileDAO.HumanReadableFilesize(progressArgs.Total - progressArgs.Remains) + " / " + FileDAO.HumanReadableFilesize(_selectedFile.FileSize); tbSpeed.Text = progressArgs.Speed.HasValue ? FileDAO.HumanReadableFilesize((long)progressArgs.Speed.Value) + "/s" : ""; Console.WriteLine(progressArgs); }); }, 云数据类型Enum); }
private void DownloadResultFile(FileListItem selectedFileItem, string selectedDicomPackageLocalPath, 云数据类型Enum 云数据类型Enum) { DownloadFileWorker.Download( selectedFileItem, selectedDicomPackageLocalPath, delegate(string filename) { UIUtil.Invoke(this, delegate { try { lbWaiting.Visibility = Visibility.Hidden; ResumeGUI(); while (!File.Exists(selectedDicomPackageLocalPath)) { } //Thread.Sleep(1000); openPatientsMsgWindow(selectedDicomPackageLocalPath); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }); }, delegate(string errMsg) { UIUtil.Invoke(this, delegate { MessageBox.Show(errMsg); ResumeGUI(); }); }, delegate(Exception ex) { UIUtil.Invoke(this, delegate { Util.ShowExceptionMessage(ex); //Download(selectedFile, selectedDicomPackageLocalPath, 云数据类型Enum.处理结果); ResumeGUI(); }); }, delegate(ProgressArgs progressArgs) { UIUtil.Invoke(this, delegate { lbWaiting.Content = "正在下载,请稍候。" + progressArgs.ToString(); lbDownloadProgress.Content = progressArgs.ToString(); Console.WriteLine(progressArgs); }); }, 云数据类型Enum); }
private void DownloadAirwayResultFileWithoutOpen(FileListItem selectedFileItem, string selectedAirwayPackageLocalPath, 云数据类型Enum 云数据类型Enum) { DownloadFileWorker.Download( selectedFileItem, selectedAirwayPackageLocalPath, delegate(string filename) { UIUtil.Invoke(this, delegate { try { while (!File.Exists(selectedAirwayPackageLocalPath)) { } //Thread.Sleep(1000); Process.Start(System.IO.Path.GetDirectoryName(selectedAirwayPackageLocalPath)); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }); }, delegate(string errMsg) { UIUtil.Invoke(this, delegate { MessageBox.Show(errMsg); }); }, delegate(Exception ex) { UIUtil.Invoke(this, delegate { Util.ShowExceptionMessage(ex); //Download(selectedFile, selectedDicomPackageLocalPath, 云数据类型Enum.处理结果); }); }, delegate(ProgressArgs progressArgs) { UIUtil.Invoke(this, delegate { Console.WriteLine(progressArgs.Percentage.Value); Progress.Value = progressArgs.Percentage.Value; tbPercent.Text = ((progressArgs.Percentage.Value * 100).ToString("F2")).ToString() + " %"; Console.WriteLine(progressArgs); }); }, 云数据类型Enum); }
private void Download(FileListItem selectedFile, string selectedDicomPackageLocalPath, 云数据类型Enum 云数据类型Enum) { DownloadFileWorker.Download( selectedFile, selectedDicomPackageLocalPath, delegate(string filename) { UIUtil.Invoke(this, delegate { try { string tempPath = selectedDicomPackageLocalPath.Substring(0, selectedDicomPackageLocalPath.LastIndexOf(Path.DirectorySeparatorChar)); System.Diagnostics.Process.Start(tempPath); ResumeGUI(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }); }, delegate(string errMsg) { UIUtil.Invoke(this, delegate { MessageBox.Show(errMsg); ResumeGUI(); }); }, delegate(Exception ex) { UIUtil.Invoke(this, delegate { Util.ShowExceptionMessage(ex); //Download(selectedFile, selectedDicomPackageLocalPath, 云数据类型Enum.处理结果); ResumeGUI(); }); }, delegate(ProgressArgs progressArgs) { UIUtil.Invoke(this, delegate { Console.WriteLine(progressArgs); }); }, 云数据类型Enum); }
public static void DownloadDicomFileListItem(FileListItem file) { DownloadFileWorker.Download( file, "", delegate(string filename) { }, delegate(string errMsg) { MessageBox.Show("下载发生异常!", "提示"); }, delegate(Exception ex) { Util.ShowExceptionMessage(ex); }, delegate(ProgressArgs progressArgs) { progressArgs.ToString(); Console.WriteLine(progressArgs); }, 云数据类型Enum.Dicom数据压缩包); }
private void DownloadDicom(FileListItem selectedFile, DataListItem dataListItem, string selectedDicomPackageLocalPath, 云数据类型Enum 云数据类型Enum) { DownloadFileWorker.Download( selectedFile, selectedDicomPackageLocalPath, delegate(string filename) { UIUtil.Invoke(this, delegate { try { //string tempPath = selectedDicomPackageLocalPath.Substring(0, selectedDicomPackageLocalPath.LastIndexOf(Path.DirectorySeparatorChar)); //System.Diagnostics.Process.Start(tempPath); //ResumeGUI(); lbWaiting.Visibility = Visibility.Hidden; ResumeGUI(); while (!File.Exists(selectedDicomPackageLocalPath)) { } //System.Diagnostics.Process.Start(System.IO.Path.GetDirectoryName(selectedDicomPackageLocalPath)); string destFolder = AirwayPatients.BaseDicomFolder + "\\" + dataListItem.PatientName + "_" + dataListItem.StudyInstanceUID; //解压缩并用dicomviewer打开 FileDAO.upZip(selectedDicomPackageLocalPath, destFolder); ImportDicomWindow3 dicomViewer = new ImportDicomWindow3(destFolder); dicomViewer.ShowDialog(); //Thread.Sleep(1000); //openPatientsMsgWindow(selectedDicomPackageLocalPath); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }); }, delegate(string errMsg) { UIUtil.Invoke(this, delegate { MessageBox.Show(errMsg); ResumeGUI(); }); }, delegate(Exception ex) { UIUtil.Invoke(this, delegate { Util.ShowExceptionMessage(ex); //Download(selectedFile, selectedDicomPackageLocalPath, 云数据类型Enum.处理结果); ResumeGUI(); }); }, delegate(ProgressArgs progressArgs) { UIUtil.Invoke(this, delegate { lbWaiting.Content = "正在下载,请稍候。" + progressArgs.ToString(); lbDownloadProgress.Content = progressArgs.ToString(); Console.WriteLine(progressArgs); }); }, 云数据类型Enum); }