コード例 #1
0
ファイル: EpubPackage.cs プロジェクト: zhukezhuke/ExportBlog
        private void Init(bool getList)
        {
            baseDir += _fileName;
            if (Directory.Exists(baseDir))
            {
                Directory.Delete(baseDir, true);
            }
            Directory.CreateDirectory(baseDir);
            baseDir += "\\";

            _callback("正在准备EPUB必须文件");
            Directory.CreateDirectory(baseDir + "META-INF");
            CreateFile(baseDir + "META-INF\\container.xml", strContainer);
            CreateFile(baseDir + "mimetype", strMimetype);
            WebUtility web = new WebUtility();

            web.URL = strCover;
            web.DownloadFile(baseDir + "cover.png");
            CreateFile(baseDir + "stylesheet.css", strStyle);
            CreateFile(baseDir + "titlepage.xhtml", strTitlepage);

            if (getList)
            {
                _callback("正在获取文章列表");
                items = feedService.GetList();
                _callback("共获取到【" + items.Count + "】篇文章");
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var list  = feedService.GetList();
            int total = 0;
            int cnt   = checkedListBox1.Items.Count;

            for (int i = 0; i < cnt; i++)
            {
                if (!checkedListBox1.GetItemChecked(i))
                {
                    list[cnt - i - 1].IsDown = false;
                    total++;
                }
            }
            if (total == checkedListBox1.Items.Count)
            {
                MessageBox.Show("请选择要导出的文章。");
                return;
            }
            this.DialogResult = DialogResult.OK;
            this.Dispose();
        }
コード例 #3
0
        private void Init(bool getList)
        {
            if (!CheckChmInstalled())
            {
                isok = false;
                _callback("抱歉,您的电脑没有安装CHM阅读器,无法生成。");
                return;
            }
            baseDir += _fileName;
            if (Directory.Exists(baseDir))
            {
                Directory.Delete(baseDir, true);
            }
            Directory.CreateDirectory(baseDir);
            baseDir += "\\";
            Directory.CreateDirectory(baseDir + "html");

            if (getList)
            {
                _callback("正在获取文章列表");
                items = feedService.GetList();
                _callback("共获取到【" + items.Count + "】篇文章");
            }
        }
コード例 #4
0
ファイル: PdfPackage.cs プロジェクト: zhukezhuke/ExportBlog
 private void Init(bool getList)
 {
     if (File.Exists(baseDir + _fileName))
     {
         File.Delete(baseDir + _fileName);
     }
     if (getList)
     {
         _callback("正在获取文章列表");
         items = feedService.GetList();
         _callback("共获取到【" + items.Count + "】篇文章");
     }
     baseFT = CreateChineseFont();
     codeFT = FontFactory.GetFont("Courier", 10, BaseColor.DARK_GRAY);
 }
コード例 #5
0
ファイル: HtmlPackage.cs プロジェクト: zhukezhuke/ExportBlog
        private void Init(bool getList)
        {
            baseDir += _fileName;
            if (Directory.Exists(baseDir))
            {
                Directory.Delete(baseDir, true);
            }
            Directory.CreateDirectory(baseDir);
            baseDir += "\\";

            if (getList)
            {
                _callback("正在获取文章列表");
                items = feedService.GetList();
                _callback("共获取到【" + items.Count + "】篇文章");
            }
        }