Beispiel #1
0
        }     // Download

        private void SegmentPayloadReceived(object sender, PayloadStorage.SegmentPayloadReceivedEventArgs e)
        {
            //Console.WriteLine($@"{e.SegmentIdentity}:{e.Payload.Length} ({_streamClient.DatagramCount} received)");
            _processor.AddSegment(e.Payload);

            // TODO: stop when EPG is complete
            // Notify the caller.
            // Give the caller the option to download in a continuous loop
            // or the restart the download after a given time
        } // SegmentPayloadReceived
Beispiel #2
0
        } // ProgressRunEnded

        private void ProgressSegmentReceived(PayloadStorage.SegmentPayloadReceivedEventArgs segment)
        {
            var itemData = new string[]
            {
                string.Format(segment.SegmentIdentity.ToString()),
                string.Format("-"),
                string.Format("-"),
                string.Format("{0,6:N0}", segment.SectionCount),
                string.Format("{0,6:N0}", segment.Payload.Length),
                string.Format("-"),
                (DateTime.Now - StartTime).ToString(),
            };
            var item = new ListViewItem(itemData);

            item.BackColor = SystemColors.Control;
            item.ForeColor = SystemColors.ControlText;
            listViewRuns.Items.Add(item);
            item.EnsureVisible();

            var path = Path.Combine(DumpFolderSegments, string.Format("{0}-{1}.xml", segment.SegmentIdentity, listViewRuns.Items.Count - 1));

            File.WriteAllBytes(path, segment.Payload);
        } // ProgressSegmentReceived
Beispiel #3
0
        } // Explorer_RunEnded

        private void Storage_SegmentPayloadReceived(object sender, PayloadStorage.SegmentPayloadReceivedEventArgs e)
        {
            Worker.ReportProgress(3, e);
        } // Storage_SegmentPayloadReceived