private void hTMLToolStripMenuItem1_Click(object sender, EventArgs e) { var sfd = new SaveFileDialog(); sfd.Filter = "HTML with <PRE> tag|*.html|HTML without <PRE> tag|*.html"; if (sfd.ShowDialog() == DialogResult.OK) { var html = ""; if (sfd.FilterIndex == 1) { html = fctb.Html; } if (sfd.FilterIndex == 2) { var exporter = new ExportToHtml(); exporter.UseBr = true; exporter.UseNbsp = false; exporter.UseForwardNbsp = true; exporter.UseStyleTag = true; html = exporter.GetHtml(fctb); } File.WriteAllText(sfd.FileName, html); } }
internal static string ExportAsHtml(OutlinerDocument Document, MainWindow mainWindow) { MemoryStream stream = new MemoryStream(); StreamWriter writer = new StreamWriter(stream); writer.Write(ExportToHtml.Export(Document, mainWindow)); writer.Flush(); stream.Seek(0, SeekOrigin.Begin); StreamReader reader = new StreamReader(stream); return(reader.ReadToEnd()); }
public override string GetCss() { var result = ""; if (BackgroundBrush is SolidBrush) { var s = ExportToHtml.GetColorAsString((BackgroundBrush as SolidBrush).Color); if (s != "") { result += "background-color:" + s + ";"; } } return(result); }
internal static void ExportAsHtml(OutlinerDocument Document, MainWindow wnd, string fileName, bool exportAsList) { if (exportAsList == true) { StreamWriter writer = new StreamWriter(fileName); ExportAsHtml_List(Document, writer); writer.Close(); } else { StreamWriter writer = new StreamWriter(fileName); string res = ExportToHtml.Export(Document, wnd); writer.Write(res); writer.Close(); } }
public override string GetCss() { var result = ""; if (BackgroundBrush is SolidBrush) { var s = ExportToHtml.GetColorAsString((BackgroundBrush as SolidBrush).Color); if (s != "") { result += "background-color:" + s + ";"; } } if (ForeBrush is SolidBrush) { var s = ExportToHtml.GetColorAsString((ForeBrush as SolidBrush).Color); if (s != "") { result += "color:" + s + ";"; } } if ((FontStyle & FontStyle.Bold) != 0) { result += "font-weight:bold;"; } if ((FontStyle & FontStyle.Italic) != 0) { result += "font-style:oblique;"; } if ((FontStyle & FontStyle.Strikeout) != 0) { result += "text-decoration:line-through;"; } if ((FontStyle & FontStyle.Underline) != 0) { result += "text-decoration:underline;"; } return(result); }