/// <summary> /// Process the Series delete request. /// </summary> public override void Process() { if (CancelPending) { Proxy.Cancel(); return; } if (StopPending) { Proxy.Postpone(); return; } try { var deleteSeries = new DeleteSeriesUtility(); deleteSeries.Initialize(Location, Request.SeriesInstanceUids); if (deleteSeries.DeletingAllSeries()) { var deleteStudy = new DeleteStudyUtility(); deleteStudy.Initialize(Location); Progress.IsCancelable = false; Progress.TotalImagesToDelete = deleteStudy.NumberOfStudyRelatedInstances; Progress.ImagesDeleted = 0; Proxy.UpdateProgress(); deleteStudy.Process(); } else { Progress.IsCancelable = false; Progress.TotalImagesToDelete = deleteSeries.NumberOfSeriesRelatedInstances; Progress.ImagesDeleted = 0; Proxy.UpdateProgress(); deleteSeries.Process(); } Progress.ImagesDeleted = Progress.TotalImagesToDelete; Proxy.Complete(); } catch (Exception) { Progress.IsCancelable = true; throw; } }
public override void Process() { if (CancelPending) { Proxy.Cancel(); return; } if (StopPending) { Proxy.Postpone(); return; } try { // Reset progress, in case of retry Progress.IsCancelable = false; Progress.ImagesDeleted = 0; Progress.TotalImagesToDelete = 0; var delete = new DeleteStudyUtility(); delete.Initialize(Location); Progress.TotalImagesToDelete = delete.NumberOfStudyRelatedInstances; Proxy.UpdateProgress(); delete.Process(); Progress.ImagesDeleted = delete.NumberOfStudyRelatedInstances; Proxy.Complete(); } catch (Exception) { Progress.IsCancelable = true; throw; } }