} // StpClient_SegmentDownloadRestarted void StpClient_SegmentDownloadCompleted(object sender, DvbStpEnhancedClient.SegmentDownloadCompletedEventArgs e) { var data = new SegmentProgressReport() { Index = e.SegmentListIndex, ReceivedSections = e.SectionCount, SectionCount = e.SectionCount }; Worker.ReportProgress(19, data); } // StpClient_SegmentDownloadCompleted
} // DisplaySegmentProgress private void DisplaySegmentProgress(ListViewItem item, SegmentProgressReport report) { var progress = report.ReceivedSections / ((double)report.SectionCount); item.SubItems[1].Text = string.Format(Properties.Texts.DownloadFragmentProgressFormat, report.ReceivedSections, report.SectionCount); item.SubItems[2].Text = string.Format(Properties.Texts.DownloadSegmentProgressFormat, progress); GlobalProgress -= PayloadProgress[report.Index]; GlobalProgress += progress; PayloadProgress[report.Index] = progress; var pct = GlobalProgress / PayloadProgress.Length; labelProgressPct.Text = string.Format(FormatProgressPercentage, pct); progressBar.Value = (int)(pct * 1000); } // DisplaySegmentProgress