Beispiel #1
0
        protected DownloadResultList ShowDialogWithResult(DownloadRequestList objDownloadRequests, DownloadDialogSettings objDownloadDialogSettings)
        {
            _objDownloadRequests       = objDownloadRequests;
            _objDownloadDialogSettings = objDownloadDialogSettings;

            ThreadStart objThreadStart = new ThreadStart(DownloadThread);

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

            this.ShowDialog();

            return(_objDownloadResults);
        }
Beispiel #2
0
        public DownloadResultList DownloadWithDialog(DownloadRequestList objDownloadRequests, DownloadDialogSettings objDownloadDialogSettings)
        {
            if (objDownloadRequests == null)
            {
                throw new ArgumentNullException("objDownloadRequests", "A valid non-null DownloadRequestList is expected");
            }
            if (objDownloadDialogSettings == null)
            {
                throw new ArgumentNullException("objDownloadDialogSettings", "A valid non-null DownloadDialogSettings is expected");
            }

            DownloadResultList objDownloadResults = DownloadDialog.ShowDialog(objDownloadRequests, objDownloadDialogSettings);

            return(objDownloadResults);
        }
Beispiel #3
0
        public static DownloadResultList ShowDialog(DownloadRequestList objDownloadRequests, DownloadDialogSettings objDownloadDialogSettings)
        {
            if (objDownloadRequests == null)
            {
                throw new ArgumentNullException("objDownloadRequests", "A valid non-null DownloadRequestList is expected");
            }
            if (objDownloadDialogSettings == null)
            {
                throw new ArgumentNullException("objDownloadDialogSettings", "A valid non-null DownloadDialogSettings is expected");
            }

            DownloadResultList objDownloadResults = null;

            using (DownloadDialog objFileDownloadDialog = new DownloadDialog())
            {
                objDownloadResults = objFileDownloadDialog.ShowDialogWithResult(objDownloadRequests, objDownloadDialogSettings);
            }

            return(objDownloadResults);
        }
Beispiel #4
0
        public DownloadResultList DownloadWithDialog(DownloadRequest objDownloadRequest, DownloadDialogSettings objDownloadDialogSettings)
        {
            if (objDownloadRequest == null)
            {
                throw new ArgumentNullException("objDownloadRequest", "A valid non-null DownloadRequest is expected");
            }
            if (objDownloadDialogSettings == null)
            {
                throw new ArgumentNullException("objDownloadDialogSettings", "A valid non-null DownloadDialogSettings is expected");
            }

            DownloadRequestList objDownloadRequests = new DownloadRequestList();

            objDownloadRequests.Add(objDownloadRequest);

            return(DownloadWithDialog(objDownloadRequests, objDownloadDialogSettings));
        }