예제 #1
0
        public UploadResultList UploadWithoutDialog(UploadRequestList objUploadRequests)
        {
            if (objUploadRequests == null)
            {
                throw new ArgumentNullException("objUploadRequests", "A valid non-null UploadRequestList is expected");
            }

            _objJobResult = null;
            IEnumerable <ITask> objTasks = objUploadRequests.GetTasks();

            Job objUploadJob = new Job(objTasks);

            objUploadJob.JobEnd += new Job.OnJobEndDelegate(objUploadJob_JobEnd);
            objUploadJob.Start();
            objUploadJob.Wait();

            UploadResultList objUploadResults = new UploadResultList();

            if (_objJobResult != null)
            {
                foreach (ITaskResult objTaskResult in _objJobResult.TaskResults)
                {
                    UploadResult objUploadResult = (UploadResult)objTaskResult;
                    objUploadResults.Add(objUploadResult);
                }
            }

            return(objUploadResults);
        }
예제 #2
0
        public UploadResultList UploadWithDialog(UploadRequestList objUploadRequests, UploadDialogSettings objUploadDialogSettings)
        {
            if (objUploadRequests == null)
            {
                throw new ArgumentNullException("objUploadRequests", "A valid non-null UploadRequestList is expected");
            }

            UploadResultList objUploadResults = UploadDialog.ShowDialog(objUploadRequests, objUploadDialogSettings);

            return(objUploadResults);
        }
예제 #3
0
        public UploadResultList UploadWithoutDialog(UploadRequest objUploadRequest)
        {
            if (objUploadRequest == null)
            {
                throw new ArgumentNullException("objUploadRequest", "A valid non-null UploadRequest is expected");
            }

            UploadRequestList objUploadRequests = new UploadRequestList();

            objUploadRequests.Add(objUploadRequest);

            return(UploadWithoutDialog(objUploadRequests));
        }
예제 #4
0
        protected UploadResultList ShowDialogWithResult(UploadRequestList objUploadRequests, UploadDialogSettings objUploadDialogSettingss)
        {
            _objUploadRequests       = objUploadRequests;
            _objUploadDialogSettings = objUploadDialogSettingss;

            ThreadStart objThreadStart = new ThreadStart(UploadThread);

            _objUploadThread = new Thread(objThreadStart);
            _objUploadThread.IsBackground = true;
            _objUploadThread.Start();

            this.ShowDialog();

            return(_objUploadResults);
        }
예제 #5
0
        public static UploadResultList ShowDialog(UploadRequestList objUploadRequests, UploadDialogSettings objUploadDialogSettingss)
        {
            if (objUploadRequests == null)
            {
                throw new ArgumentNullException("objUploadRequests", "A valid non-null UploadRequestList is expected");
            }
            if (objUploadDialogSettingss == null)
            {
                throw new ArgumentNullException("objUploadDialogSettingss", "A valid non-null UploadDialogSettings is expected");
            }

            UploadResultList objUploadResults = null;

            using (UploadDialog objFileUploadDialog = new UploadDialog())
            {
                objUploadResults = objFileUploadDialog.ShowDialogWithResult(objUploadRequests, objUploadDialogSettingss);
            }

            return(objUploadResults);
        }
예제 #6
0
 public UploadResultList UploadWithDialog(UploadRequestList objUploadRequests)
 {
     return(UploadWithDialog(objUploadRequests, new UploadDialogSettings()));
 }