Exemplo n.º 1
0
        /// <summary>
        /// Constructor of DownloadManagerProgress
        /// </summary>
        /// <param name="startDownloadArg">Information about start downloading call</param>
        /// <param name="parent">Source download manager</param>
        /// <exception cref="ArgumentNullException">startDownloadArg, parent must be not null.</exception>
        public ManagerInformation(StartDownloadArg startDownloadArg, DownloadManager parent)
        {
            if (startDownloadArg == null)
            {
                throw new ArgumentNullException("startDownloadArg");
            }
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            _parent = parent;

            StartArgs = startDownloadArg;
            SetSeriesToDownload(); // by default all series from initial list should be downloaded
        }
Exemplo n.º 2
0
        /// <summary>
        /// Start downloading
        /// </summary>
        /// <param name="startDownloadArg">Download args</param>
        /// <exception cref="ArgumentNullException">args must be not null.</exception>
        /// <exception cref="InvalidOperationException">Throws if previous download commnad is stiil active.</exception>
        internal void Start(StartDownloadArg startDownloadArg)
        {
            if (startDownloadArg == null)
            {
                throw new ArgumentNullException("startDownloadArg");
            }
            if (IsBusy)
            {
                throw new InvalidOperationException("The previous download command is still active.");
            }

            Information        = new ManagerInformation(startDownloadArg, this);
            _downloadManagerUI = new DownloadManagerUI(this);
            ShowUI();

            DoLogInfo("Starting downloading...");
            _worker.RunWorkerAsync();
        }