Пример #1
0
        public void ShowTocList(MixTocInfo mixToc, TocSummmaryInfo[] tocs, Action <int> callback)
        {
            mMixToc   = mixToc;
            mTocs     = tocs;
            mCallback = callback;
            listview_toc.BeginUpdate();
            //添加混合源
            ListViewItem mixTocItem = new ListViewItem();

            mixTocItem.Text = "混合源";
            mixTocItem.SubItems.Add(mMixToc.chapters.Length.ToString());
            mixTocItem.SubItems.Add(mMixToc.chapters[mMixToc.chapters.Length - 1].title);
            mixTocItem.SubItems.Add(mMixToc.updated);
            listview_toc.Items.Add(mixTocItem);
            foreach (var toc in tocs)
            {
                ListViewItem item = new ListViewItem();
                item.Text = toc.name;
                item.SubItems.Add(toc.chaptersCount.ToString());
                item.SubItems.Add(toc.lastChapter);
                item.SubItems.Add(toc.updated);
                listview_toc.Items.Add(item);
            }

            listview_toc.EndUpdate();
            this.Show();
        }
Пример #2
0
        public void ShowBook(QueryBookInfo book)
        {
            mBook           = book;
            label_name.Text = book.title;
            string wordCount = book.wordCount + "字";

            if (book.wordCount >= 10000)
            {
                wordCount = (book.wordCount / 10000) + " 万字";
            }
            label_baseinfo.Text = book.author + " | " + book.cat + " | " + wordCount;
            if (!string.IsNullOrWhiteSpace(book.retentionRatio))
            {
                label_retentionRatio.Text = "追书留存率:" + book.retentionRatio + "%";
            }
            else
            {
                label_retentionRatio.Text = "追书留存率:无数据";
            }

            label_latelyFollower.Text = "追书人数:" + book.latelyFollower + " 人";
            label_lastChapter.Text    = "最后更新章节:" + book.lastChapter;
            label_site.Text           = "首发网站:" + book.site;
            textBox_shortIntro.Text   = book.shortIntro;
            string url           = book.cover;
            int    urlStartIndex = url.IndexOf("http:");

            if (urlStartIndex >= 0)
            {
                url = url.Substring(urlStartIndex);
                picturebox_cover.ImageLocation = url;
            }

            mMixToc = LibZhuiShu.getMixToc(mBook._id);
            mTocs   = LibZhuiShu.getTocSummary(mBook._id);
            if (mMixToc != null)
            {
                changeToc(-1);
            }
            else if (mTocs != null && mTocs.Length > 0)
            {
                changeToc(0);
            }
            else
            {
                MessageBox.Show("无可用的书源!");
                return;
            }

            this.Show();
        }