Exemplo n.º 1
0
        /// <summary>
        /// Get the next Download from the queue and start it
        /// </summary>
        /// <returns>True when done</returns>
        public bool DownloadNextFromQueue()
        {
            if (downloadQueue.Count > 0)
            {
                Download next = (Download)downloadQueue.Pop();
                Logger.Log("Downloading next item from queue '" + next.manga.name + " chapter " + next.chapterNumber + "'");                next.StartDownloading();
                startPage.StartDownloadGUI();
                return(false);
            }
            else
            {
                foreach (Download d in downloads)
                {
                    Logger.Log("Deleting '" + d.manga.MangaDirectory + "\\downloading" + "'");
                    if (File.Exists(d.manga.MangaDirectory + "\\downloading"))
                    {
                        File.Delete(d.manga.MangaDirectory + "\\downloading");
                    }
                }

                startPage.StopDownloadGUI();
                downloadQueue.Clear();
                downloads.Clear();
                downloadCount = 0;
                return(true);
            }
        }