public int GetPercentComplete(Guid processId) { BatchUploader wrapper = null; if (batchUploaders.TryGetValue(processId, out wrapper)) { return(wrapper.Percentage); } exceptionHandler.ShieldException(new ArgumentOutOfRangeException(String.Format("No process with ID {0)", processId))); return(0); }
public UploadStatus CheckStatus(Guid processId, String user) { BatchUploader wrapper = null; if (batchUploaders.TryGetValue(processId, out wrapper)) { BackgroundWorker batchUploader = wrapper.GetBatchUploader(); if (batchUploader.IsBusy) { return(UploadStatus.Running); } } return(queueManager.GetStatus(processId, user)); }
public UploadStatus CancelBatch(Guid processId, String userId) { BatchUploader wrapper = null; if (batchUploaders.TryGetValue(processId, out wrapper)) { BackgroundWorker batchUploader = wrapper.GetBatchUploader(); if (batchUploader.IsBusy) { batchUploader.CancelAsync(); return(UploadStatus.Cancelled); } return(UploadStatus.Processed); } // Message contract exceptionHandler.ShieldException(new ArgumentOutOfRangeException(String.Format("No process with ID {0)", processId))); return(UploadStatus.Invalid); }