public YoutubeDownloadInfo(YoutubeDownload download) { Status = download.CurrentStatus; if (download.CurrentStatus == YoutubeDownload.Status.None) return; else { SearchTerm = download.SearchTerm; DownloadDirectory = download.DownloadDirectory; } if (download.CurrentStatus == YoutubeDownload.Status.Searching) { return; } else { URL = download.URL; } if (download.CurrentStatus == YoutubeDownload.Status.VideoDownloadComplete || download.CurrentStatus == YoutubeDownload.Status.VideoDownloading) { FileName = download.FileName; } }
public DownloadClosingEventArgs(YoutubeDownloadInfo info, YoutubeDownload.ReasonForClose closeReason) : this(info) { ReasonForClose = closeReason; }
private void addDownload(string search, string downloadDirectory) { YoutubeDownload temp = new YoutubeDownload(); temp.Location = _downloadLocation; temp.VideoFromPlaylistUrlFound += new YoutubeDownload.FoundUrlEvent(YoutubeDownload_VideoFromPlaylistUrlFound); temp.Notification += new YoutubeDownload.NotificationEvent(YoutubeDownload_NotificationEvent); temp.DownloadClosing += new YoutubeDownload.DownloadClosingEvent(YoutubeDownload_DownloadClosing); temp.DownloadComplete += new YoutubeDownload.DownloadCompleteEvent(YoutubeDownload_DownloadComplete); temp.Start(downloadDirectory, search); if (YoutubeDownloadStarted != null) YoutubeDownloadStarted(this, new YoutubeDownloadStartedEventArgs(downloadDirectory, search)); addControl(temp); Downloads.Add(temp); _downloadLocation.Y += _VirticalDistanceBetweenDownloadControls; }
private void moveDownload(YoutubeDownload download, Point p) { if (download.InvokeRequired) { moveDownloadDeligate d = new moveDownloadDeligate(moveDownload); download.Invoke(d, new object[] { download, p }); } else { download.Location = p; } }
private void addControl(YoutubeDownload download) { if (_masterform.InvokeRequired) { addControlCallBack d = new addControlCallBack(addControl); _masterform.Invoke(d, new object[] { download }); } else { _masterform.Controls.Add(download); } }