Exemplo n.º 1
0
        private void startReadBtn_Click(object sender, EventArgs e)
        {
            DownLoadFile downFile = null;
            DownTask     downTask;
            ComicReader  reader = new ComicReader();

            foreach (CheckBox i in checkPanel.Controls)
            {
                if (i.Checked)
                {
                    if (downUrlDic.ContainsKey(i.Text))
                    {
                        downFile           = new DownLoadFile();
                        downFile.ComicUrl  = downUrlDic[i.Text];
                        downFile.ComicName = comicNameLabel.Text.Substring(4) + i.Text;
                        downFile.SavePath  = "temp\\";
                        break;
                    }
                }
            }

            if (downFile == null)
            {
                return;
            }

            downTask = new DownTask();
            downTask.addFileEvent += reader.AddFileToList;
            downTask.ComicName     = downFile.ComicName;
            downTask.DownLoadPath  = downFile.SavePath;
            downTask.ReferUrl      = downFile.ComicUrl;
            downTask.GetNetComic(downFile);
            reader.StartRead();
            reader.Show();
        }
Exemplo n.º 2
0
        private void startReadBtn_Click(object sender, EventArgs e)
        {
            DownLoadFile downFile = null;
            DownTask     downTask;
            ComicReader  reader = new ComicReader();

            reader.readFinishedEvent += Reader_readFinishedEvent;
            ListViewItemInfo item = currentItem as ListViewItemInfo;

            foreach (Controls.CheckBoxEx i in checkPanel.Controls)
            {
                if (i.Checked)
                {
                    if (item.UrlDictronary.ContainsKey(i.FullText))
                    {
                        downFile           = new DownLoadFile();
                        downFile.ComicUrl  = item.UrlDictronary[i.FullText];
                        downFile.ComicName = comicNameLabel.Text.Substring(4) + i.Text;
                        downFile.SavePath  = "temp\\";
                        break;
                    }
                }
            }

            if (downFile == null)
            {
                return;
            }

            downTask = new DownTask();
            downTask.addFileEvent += reader.AddFileToList;
            downTask.ComicName     = downFile.ComicName;
            downTask.DownLoadPath  = downFile.SavePath;
            downTask.SourceUrl     = downFile.ComicUrl;
            downTask.GetNetComic(downFile);
            reader.StartRead();
            reader.Show();
        }