//加载按钮 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) + " - 实体编辑工具"; } }
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; } } }