GetHtml() public method

public GetHtml ( FastColoredTextBox tb ) : string
tb FastColoredTextBox
return string
コード例 #1
0
 public void ToHTML(ExportToHTML output, FastColoredTextBox source)
 {
     _fileBroker.SaveWithDialog(new HtmlFileType(), output.GetHtml(source));
 }
コード例 #2
0
        private void hTMLToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.Filter = "HTML with <PRE> tag|*.html|HTML without <PRE> tag|*.html";
            if (sfd.ShowDialog() == DialogResult.OK)
            {
                string html = "";

                if (sfd.FilterIndex == 1)
                {
                    html = fctb.Html;
                }
                if (sfd.FilterIndex == 2)
                {

                    ExportToHTML exporter = new ExportToHTML();
                    exporter.UseBr = true;
                    exporter.UseNbsp = false;
                    exporter.UseForwardNbsp = true;
                    exporter.UseStyleTag = true;
                    html = exporter.GetHtml(fctb);
                }
                File.WriteAllText(sfd.FileName, html);
            }
        }
コード例 #3
0
 private void exportHTMLToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ExportToHTML export = new ExportToHTML();
     string val = export.GetHtml(CurrentTB);
     val = val.Replace(".fctbNone{", "body{background-color:" + background.Name.Substring(2) + ";}.fctbNone{");
     val = val.Replace("font-size: " + CurrentTB.Font.Size + "pt;", "font-size: 9pt;");
     StreamWriter sw = new StreamWriter(Path.Combine(Application.StartupPath, CurrentTB.Name + ".html"), false, Encoding.UTF8);
     sw.Write(val);
     sw.Close();
 }