Пример #1
0
        private void lblExit_Click(object sender, EventArgs e)
        {
            if (isDownloading)
            {
                ctsDownload.Cancel(false);

                DownloadItemManager.toDeleteFiles.Add(pathToVideo);
                DownloadItemManager.StartTimer();
            }

            if (isConverting)
            {
                //Cancel the convert task
                ctsConvert.Cancel(false);
                FFMpegConverter.Abort();

                DownloadItemManager.toDeleteFiles.Add(pathToSong);
                DownloadItemManager.StartTimer();
            }



            this.Dispose();
            if (isHistory)
            {
                BLHistory.RemoveRecord(historyRecord);
                UCHistory.RepositionDownloadItems();
            }
            else
            {
                DownloadItemManager.RepositionDownloadItems();
            }
        }
Пример #2
0
 private async void btnDownloadAll_Click(object sender, EventArgs e)
 {
     foreach (DownloadItem item in DownloadItemManager.GetDownloadItems().Where(dl => !dl.isRunning && dl.isReady)) //Start all non-running ones
     {
         item.Download();
     }
 }
Пример #3
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {
     //Capture ctrl+v events
     if (keyData == (Keys.Control | Keys.V) && btnDownloads.selected)
     {
         DownloadItemManager.AddDownloadItem(Clipboard.GetText(), ucDownloads.pnlVideos);
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
Пример #4
0
        private void bnLoadList_Click(object sender, EventArgs e)
        {
            string path = FSManager.Files.GetSelectedFileWithPath("Text Files", "*.txt");

            if (!string.IsNullOrEmpty(path))
            {
                string commaSeperatedVideoUrls = File.ReadAllText(path);

                foreach (string url in commaSeperatedVideoUrls.Split(','))
                {
                    DownloadItemManager.AddDownloadItem(url, pnlVideos);
                }
            }
        }
Пример #5
0
        private void btnPaste_Click(object sender, EventArgs e)
        {
            DownloadItem item = DownloadItemManager.AddDownloadItem(Clipboard.GetText(), pnlVideos);


            pnlLoading.Visible = false;
            lblLoading.Visible = false;

            if (BLSettings.IsAutomaticDownload)
            {
                if (item != null)
                {
                    toAutoDownloadVideos.Add(item);
                }

                tmrDownload.Start();
            }
        }
Пример #6
0
        private void btnSaveList_Click(object sender, EventArgs e)
        {
            string commaSeperatedString = "";
            string path;

            foreach (DownloadItem video in DownloadItemManager.GetDownloadItems())
            {
                if (video.theVideo != null)
                {
                    commaSeperatedString += "https://www.youtube.com/watch?v=" + video.theVideo.Id + ",";
                }
            }

            if (!string.IsNullOrEmpty(commaSeperatedString))
            {
                path = GetSelectedPathWithFileName();
                if (!string.IsNullOrEmpty(path))
                {
                    commaSeperatedString = commaSeperatedString.Substring(0, commaSeperatedString.Length - 1);
                    File.WriteAllText(path, commaSeperatedString);
                }
            }
        }
Пример #7
0
 public static void RepositionDownloadItems()
 {
     DownloadItemManager.RepositionDownloadItems(items);
 }