Ejemplo n.º 1
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
//             CreateFile();
            DockContent dc = CodeEditorManager.Create();

            dc.MdiParent = this;
            dc.Show(dockPanel);
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        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);
        }