Exemplo n.º 1
0
        private void Sw_DownloadClicked(StreamView sender, RpanData data)
        {
            Download dl = new Download(data);

            dl.DownloadEnded += Dl_DownloadEnded;
            downloads.Add(data.stream.stream_id, dl);
            tabs.Items.Add(dl.tab);
        }
Exemplo n.º 2
0
        void listStreams(ApiResponse response)
        {
            StreamView sw;
            double     vo = scroller.VerticalOffset;

            sortList(response);
            if (cbSortDescending.IsChecked == true)
            {
                response.data.Reverse();
            }
            StreamList.Children.Clear();
            streamCount = 0;
            viewCount   = 0;
            foreach (RpanData data in response.data)
            {
                streamCount++;
                viewCount += data.continuous_watchers;
                if (!string.IsNullOrWhiteSpace(tbSearch.Text) && tbSearch.Text != "Search for streams...")
                {
                    sw = new StreamView(data, tbSearch.Text);
                }
                else
                {
                    sw = new StreamView(data, "");
                }
                sw.DownloadClicked   += Sw_DownloadClicked;
                tbSearch.TextChanged += sw.SearchTermChanged;
                StreamList.Children.Add(sw);
            }
            Log(LogSeverity.Info, "Listed " + streamCount + " streams.");
            scroller.ScrollToVerticalOffset(vo);
            scroller.UpdateLayout();
            UpdateLayout();
            setTitle("RpanList - " + streamCount + " streams, " + viewCount + " viewers");
            updateRecents(response);
        }