private void ViewFrm_Load(object sender, EventArgs e) { string code = ""; if (File.Exists(FileName)) { Dictionary <int, byte[]> data; ArsslenDocument.Read(FileName, out code, out data); ArsslenDocument.CurrentDocumentRessources = data; htmlPanel1.Text = code; } else { if (openFileDialog1.ShowDialog() == DialogResult.OK) { Dictionary <int, byte[]> data; ArsslenDocument.Read(openFileDialog1.FileName, out code, out data); ArsslenDocument.CurrentDocumentRessources = data; htmlPanel1.Text = code; } else { this.Close(); } } }
private void editor1_OnSaveCalled(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == DialogResult.OK) { if (File.Exists(saveFileDialog1.FileName)) { File.Delete(saveFileDialog1.FileName); } List <string> str = new List <string>(); string code = ReplaceFileSystemImages(editor1.getHTML(), out str); ArsslenDocument.WriteDocument(saveFileDialog1.FileName, "<html><head><link rel=\"Stylesheet\" href=\"property:DocumentLibrary.Bridge.StyleSheet\" /></head><body bgcolor=black style=\"background-gradient:#666;margin:0\" color=#333><h1 align=center color=white>" + Path.GetFileNameWithoutExtension(saveFileDialog1.FileName) + "</h1><blockquote class=whitehole>" + code.Replace(" ", "") + "</blockquote></body></html>", str); } }