예제 #1
0
        private void previewPageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form1 form1;

            if (this.ActiveMdiChild is Form1)
            {
                form1 = (Form1)this.ActiveMdiChild;
                if (form1 != null)
                {
                    string srcPath    = form1.filepath;
                    string targetPath = Path.Combine(Program.BlogSiteRoot, "_drafts");
                    if (!Directory.Exists(targetPath))
                    {
                        Directory.CreateDirectory(targetPath);
                    }
                    targetPath = Path.Combine(targetPath, "temp.html");

                    string title = Path.GetFileName(srcPath);
                    SetStatus("Busy: Converting MD to Html.");
                    PandocUtil.MD2Html(Program.BlogSiteRoot, Program.WorkingDirectory, srcPath, targetPath, title);
                    frmwebBrowser wb = new frmwebBrowser();
                    wb.MdiParent   = this;
                    wb.Text        = srcPath + childFormNumber++;
                    wb.WindowState = FormWindowState.Maximized;
                    wb.PathStr     = targetPath;
                    SetStatus("Busy: Rendering Preview.");
                    wb.Show();
                }
            }
        }
예제 #2
0
        private void broswerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmwebBrowser wb = new frmwebBrowser();

            wb.MdiParent   = this;
            wb.WindowState = FormWindowState.Maximized;
            SetStatus("Busy: Rendering Preview.");
            wb.Show();
        }