// ListBox Events
        private void search_results_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Setup
            if (search_results.SelectedIndex < 0)
            {
                return;
            }
            string key   = search_results.GetItemText(search_results.SelectedItem);
            string value = comic_list[key];
            string url   = "http://www.readcomics.tv/comic/" + value;

            comic_name.Text = key;

            // Grab page source
            string html = new WebClient().DownloadString(url);

            // Get banner
            comic_picture.Load(ComicUtils.RetrieveBanner(value, html));
            comic_picture.SizeMode = PictureBoxSizeMode.Zoom;

            // Get description
            comic_description.Text = ComicUtils.RetrieveDescription(value, html);
        }
Esempio n. 2
0
        // Constructor
        public frmDownload(string rccode)
        {
            // Draw frmDownload
            InitializeComponent();
            MaterialSkinManager manager = MaterialSkinManager.Instance;

            manager.AddFormToManage(this);
            manager.Theme       = MaterialSkinManager.Themes.DARK;
            manager.ColorScheme = new ColorScheme(Primary.DeepPurple400, Primary.Grey900, 0, Accent.DeepPurple200, TextShade.BLACK);

            // Setup
            CheckForIllegalCrossThreadCalls = false;
            download_name   = File.ReadAllText("data\\" + rccode + "\\detail.txt");
            download_rccode = rccode;
            comic_name.Font = new Font("Roboto", 13f, FontStyle.Regular);
            comic_name.Text = download_name;
            if (!File.Exists("data\\" + rccode + "\\desc.txt"))
            {
                comic_description.Text = ComicUtils.RetrieveDescription(rccode);

                File.WriteAllText("data\\" + rccode + "\\desc.txt", comic_description.Text);
            }
            else
            {
                comic_description.Text = File.ReadAllText("data\\" + rccode + "\\desc.txt");
            }
            FileStream stream = new FileStream("data\\" + rccode + "\\banner.jpg", FileMode.Open, FileAccess.Read);

            comic_picture.BackgroundImage = Image.FromStream(stream);
            stream.Dispose();
            autofindpages.Checked        = true;
            comic_chapternum.KeyPress   += comic_chapternum_KeyPress;
            comic_startpagenum.KeyPress += comic_startpagenum_KeyPress;
            comic_endpagenum.KeyPress   += comic_endpagenum_KeyPress;
            bulk_chapternums.KeyPress   += bulk_chapternums_KeyPress;
        }