Ejemplo n.º 1
0
        public Segment(long taille, long debut, Download downloader, DownloadManagerM manager)
        {
            this.size = taille;
            this.startIndex = debut;
            this.content = null;
            this.download = downloader;
            this.manager = manager;
            offset = 0;
            nbreRestart = 0;

            this.threadLock = new object();
        }
Ejemplo n.º 2
0
        public DownloadInfo(String urlVideoFile, String videoTitre, long videoTaille, String filePath, String extension, DownloadManagerMV managerMV, DownloadManagerM managerM, Download download, int videoIndex = -1)
        {
            this.p_downloadManagerMV = managerMV;
            this.p_downloadManagerM = managerM;
            this.p_titre = videoTitre;
            this.p_taille = videoTaille;
            this.urlVideoFile = urlVideoFile;
            this.p_saveFilePath = filePath;
            this.p_fileExtension = extension;
            this.download = download;
            this.fileExistsAlready = false;
            this.videoIndex = videoIndex;

            SetFileName();
            CheckIndexation();

            p_downloaded = 0;
            p_lastTime = DateTime.Now;
            downloadedLast = 0;
            p_speed = 0;
        }
Ejemplo n.º 3
0
 internal void DownloadFini(Download download)
 {
     try
     {
         listeDownload.Remove(download);
         managerMV.DownloadFini(download.videoInfo);
     }
     catch (Exception ex)
     {
         AddErrorMsg("DownloadManagerM.DownloadFini ", ex);
     }
 }
Ejemplo n.º 4
0
 internal void AddNewDownload(Download download)
 {
     try
     {
         listeDownload.Add(download);
         managerMV.AddNewDownload(download.videoInfo);
         waitingListeSegment.InsertRange(0, download.segments);
         CheckWaitingListe();
     }
     catch (Exception ex)
     {
         download.Cancel();
         AddErrorMsg("DownloadManagerM.AddNewDownload ", ex);
     }
 }
Ejemplo n.º 5
0
        public bool AlreadyDownloading(Download download)
        {
            try
            {
                lock (listeDownload)
                {
                    foreach (Download d in listeDownload)
                    {
                        if (d.urlPageVideo.Equals(download.urlPageVideo))
                            return true;
                    }
                }
                return false;

            }
            catch (Exception ex)
            {
                AddErrorMsg("DownloadManagerM.AlreadyDownloading ", ex);
                return true;
            }
        }