Пример #1
0
 private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         TempNode SelNode  = (TempNode)this.treeView1.SelectedNode;
         string   selstr   = SelNode.Text;
         string   filepath = SelNode.FilePath;
         if (filepath.Trim() != "")
         {
             CodeTemplate codetempfrm = (CodeTemplate)Application.OpenForms["CodeTemplate"];
             if (codetempfrm != null)
             {
                 codetempfrm.SettxtTemplate(filepath);
             }
             else
             {
                 MessageBox.Show("尚未打开模版代码生成编辑器!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else
         {
             MessageBox.Show("所选文件已经不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
 private void 打开生成ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         TempNode tempNode = (TempNode)this.treeView1.SelectedNode;
         string   arg_17_0 = tempNode.NodeID;
         string   text     = tempNode.Text;
         string   filePath = tempNode.FilePath;
         string   nodeType = tempNode.NodeType;
         if (filePath.Trim() != "")
         {
             string a;
             if ((a = nodeType) != null)
             {
                 if (a == "folder")
                 {
                     goto IL_DF;
                 }
                 if (a == "tt" || a == "cmt")
                 {
                     CodeTemplate codeTemplate = (CodeTemplate)Application.OpenForms["CodeTemplate"];
                     if (codeTemplate != null)
                     {
                         codeTemplate.SettxtTemplate(filePath);
                         goto IL_DF;
                     }
                     MessageBox.Show("尚未打开模版代码生成器!请选中表,然后右键打开模版代码生成器。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                     goto IL_DF;
                 }
             }
             if (File.Exists(filePath))
             {
                 this.mainfrm.AddTabPage(text, new CodeEditor(filePath, nodeType, false));
             }
         }
         else
         {
             MessageBox.Show("所选文件已经不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
         }
         IL_DF :;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }