using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using MyDownloader.Extension.Video; using System.IO; using MyDownloader.Core.UI; namespace MyDownloader.Extension.Video.UI { public partial class SupportedVideoSitesForm : Form { VideoDownloadExtension extension; public SupportedVideoSitesForm() { InitializeComponent(); } private void SupportedVideoSitesForm_Load(object sender, EventArgs e) { extension = (VideoDownloadExtension)AppManager.Instance.Application.GetExtensionByType(typeof(VideoDownloadExtension)); for (int i = 0; i < extension.Handlers.Count; i++) { this.lstSites.Items.Add(extension.Handlers[i]); } if (this.lstSites.Items.Count > 0) { this.lstSites.SelectedIndex = 0; } } private void lstSites_SelectedIndexChanged(object sender, EventArgs e) { VideoDownloadHandler handler = (VideoDownloadHandler)lstSites.Items[lstSites.SelectedIndex]; Type t = handler.Type; string logoName = t.Namespace + ".Logos." + t.Name + ".png"; using (Stream s = t.Assembly.GetManifestResourceStream(logoName)) { pictureBox1.Image = Image.FromStream(s); } } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)