public Download(DownloadSpecifier downloadSpecifier, string localPath) { DownloadSpecifier = downloadSpecifier; LocalPath = localPath; LocalDirectory = Path.GetDirectoryName(LocalPath); LocalFileName = Path.GetFileName(LocalPath); DownloadSegments = new ObservableDownloadSegmentCollection(); }
public DownloadSegment(DownloadSpecifier downloadSpecifier, Segment segment, int index) : base(segment.StartPosition, segment.EndPosition) { DownloadSpecifier = downloadSpecifier; CurrentPosition = StartPosition; Index = index; StartTime = DateTime.Now; m_lastRateTime = StartTime; m_rate = 0; }
private IEnumerable<DownloadSegment> GetDownloadSegments(int segments, DownloadSpecifier downloadSpecifier) { IEnumerable<Segment> calculatedSegments = GetSegments(segments, downloadSpecifier.RemoteFileInfo); return calculatedSegments.Select((s, idx) => new DownloadSegment(downloadSpecifier, s, idx + 1)); }