Exemplo n.º 1
0
        internal void SegmentFini(Segment segment)
        {
            try
            {
                listeSegmentEnCours.Remove(segment);
                segment.download.nombreSegmentsActifs--;

                CheckWaitingListe();
            }
            catch (Exception ex)
            {
                AddErrorMsg("DownloadManagerM.SegmentFini ", ex);
            }
        }
Exemplo n.º 2
0
 internal void PauseSegment(Segment segment)
 {
     try
     {
         lock (thisLock)
         {
             listeSegmentEnCours.Remove(segment);
             segment.download.nombreSegmentsActifs--;
             waitingListeSegment.Add(segment);
             CheckWaitingListe();
             segment.download.videoInfo.RaisePropertyChangedEvent("speed");
             segment.download.videoInfo.RaisePropertyChangedEvent("TimeLeft");
         }
     }
     catch (Exception ex)
     {
         AddErrorMsg("DownloadManagerM.PauseSegment ", ex);
     }
 }
Exemplo n.º 3
0
 private void Restart(Segment segment)
 {
     UpdateProgress(-segment.offset);
     segment.offset = 0; ;
     segment.nbreRestart++;
     download.PauseSegment(segment);
 }
Exemplo n.º 4
0
        internal void SegmentFini(Segment segment)
        {
            try
            {
                manager.SegmentFini(segment);
                lock (fichierLocal)
                {
                    if (fichierLocal != null)
                    {
                        fichierLocal.Seek(segment.startIndex, SeekOrigin.Begin);
                        fichierLocal.Write(segment.content, 0, segment.content.Length);
                        fichierLocal.Flush();
                    }
                }
                lock (segments) { segments.Remove(segment); }

                if (segments.Count == 0)
                    DownloadFini();

            }
            catch (Exception ex)
            {
                AddErrorMsg("Download.SegmentFini() ", ex);
            }
        }
Exemplo n.º 5
0
 internal void PauseSegment(Segment segment)
 {
     try
     {
         manager.PauseSegment(segment);
     }
     catch (Exception ex)
     {
         AddErrorMsg("Download.PauseSegment() ", ex);
     }
 }
Exemplo n.º 6
0
 internal void CancelSegment(Segment segment)
 {
     try
     {
         manager.SegmentFini(segment);
         segments.Remove(segment);
     }
     catch (Exception ex)
     {
         AddErrorMsg("Download.CancelSegment() ", ex);
     }
 }