private void toolStripMenuItem1_Click(object sender, EventArgs e) { // CreateFile(); DockContent dc = CodeEditorManager.Create(); dc.MdiParent = this; dc.Show(dockPanel); }
private void OpenDocToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) { try { DockContent dc = CodeEditorManager.Create(openFileDialog1.FileName); dc.MdiParent = this; dc.Show(dockPanel); } catch (System.Exception ex) { MessageBox.Show("打开错误!" + ex.Message); } } }
private IDockContent GetContentFromPersistString(string persistString) { Persist ps = new Persist(persistString); if (ps.TypeName == typeof(CodeEditor).ToString()) { if (ps.Params == null || string.IsNullOrEmpty(ps.Params[0])) { return(null); } try { CodeEditor ce = CodeEditorManager.Create(ps.Params[0]); ce.Text = ps.Params[1]; return(ce); } catch (System.Exception ex) { return(null); } } return(null); }