예제 #1
0
 //加载按钮
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (SlnConfig.Initialize(targetPath))
     {
         BaseType.LoadFromFile(SlnConfig.Instance.TypesPath);
         EntityDef.LoadFromFile(SlnConfig.Instance.EntityDefDir);
         RefreshEntityTree();
         m_isOpenProj = true;
         openToolStripMenuItem.Visible = false;//隐藏加载按钮
         Text = Path.GetFileNameWithoutExtension(targetPath) + " - 实体编辑工具";
     }
 }
예제 #2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var folderBrowser = new FolderBrowserDialog();

            folderBrowser.SelectedPath = SlnConfig.Instance.DefaultPath;
            if (folderBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (SlnConfig.Initialize(folderBrowser.SelectedPath))
                {
                    BaseType.LoadFromFile(SlnConfig.Instance.AliasPath);
                    EntityDef.LoadFromFile(SlnConfig.Instance.EntityDefDir);
                    RefreshEntityTree();
                    m_isOpenProj = true;
                }
            }
        }