Download MovieFinder.Viewer/Controls/HorizontalSingleRowGalleryWidget.cs from niobures/VideoSearch: direct link, hf CLI and curl.
- Browser
- Download file 1.87 kB
-
https://huggingface.co/niobures/VideoSearch/resolve/main/MovieFinder.Viewer/Controls/HorizontalSingleRowGalleryWidget.cs
- Command line
-
hf download hf://niobures/VideoSearch/MovieFinder.Viewer/Controls/HorizontalSingleRowGalleryWidget.cs
-
curl -L -o HorizontalSingleRowGalleryWidget.cs https://huggingface.co/niobures/VideoSearch/resolve/main/MovieFinder.Viewer/Controls/HorizontalSingleRowGalleryWidget.cs
1.87 kB
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel; | |
| using System.Drawing; | |
| using System.Data; | |
| using System.Text; | |
| using System.Windows.Forms; | |
| using Client.Scraper; | |
| namespace BlueTube.Viewer | |
| { | |
| public partial class HorizontalSingleRowGalleryWidget : GalleryWidgetBase | |
| { | |
| public HorizontalSingleRowGalleryWidget() | |
| { | |
| InitializeComponent(); | |
| } | |
| protected override void OnAddItems(ScrapedPage page) | |
| { | |
| if (this.kryptonPanel1.Controls.Contains(this.kryptonLabelPrivacy)) | |
| this.kryptonPanel1.Controls.Remove(this.kryptonLabelPrivacy); | |
| for (var i = 0; i < Constants.GetMaxDisplayCount(page.Videos.Count); i++) | |
| { | |
| var video = page.Videos[i]; | |
| var widget = new WebViewWidget(video, | |
| Properties.Resources.TestHtml.Replace("{0}", video.Url).Replace("{1}", video.ImageUrl). | |
| Replace("{2}", video.Title).Replace("{3}", video.Duration.ToString())); | |
| this.flowLayoutPanel.Controls.Add(widget); | |
| widget.ViewSelected += delegate(object sender, GalleryItemSelectedEventArgs e) | |
| { | |
| OnItemSelected(sender, e); | |
| }; | |
| if (Constants.ShowAds && i % 4 == 0) | |
| { | |
| var ad = CreateAdWidget(Constants.HorizontalAdId); | |
| this.flowLayoutPanel.Controls.Add(ad); | |
| } | |
| } | |
| } | |
| protected override Control WidgetContainer | |
| { | |
| get | |
| { | |
| return this.flowLayoutPanel; | |
| } | |
| } | |
| } | |
| } | |