Esempio n. 1
0
        private void btn_Ok_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count < 1)
            {
                return;
            }

            string selstr = this.listView1.SelectedItems[0].Text;

            Config.MainForm.NewDockDocument("New", CodeTypeHelper.GetCodeType(selstr), Config.MainForm.GetCodeTemplateText(selstr), selstr);
            Close();
        }
Esempio n. 2
0
        //打开文档
        void OpenDockDocument()
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.InitialDirectory = Application.ExecutablePath;
            openFile.Filter           = "所有文件 (*.*)|*.*";
            openFile.FilterIndex      = 1;
            openFile.RestoreDirectory = true;

            if (openFile.ShowDialog() == DialogResult.OK)
            {
                string fileName = openFile.FileName;
                OpenDockDocument(fileName, CodeTypeHelper.GetCodeType(Path.GetExtension(fileName)));
            }
        }