Ejemplo n.º 1
0
        private void LoadProjectStripOnClick(object sender, EventArgs e)
        {
            var folderBrowser = new FolderBrowserDialog();

            if (folderBrowser.ShowDialog() == DialogResult.OK)
            {
                if (!Directory.Exists(folderBrowser.SelectedPath))
                {
                    return;
                }
                if (!File.Exists(Path.Combine(folderBrowser.SelectedPath, Settings.Default.PROJECTCONFIG)))
                {
                    Log.Error("项目不存在,请重新创建");
                    return;
                }

                try
                {
                    var info = SerializerHelper.Deserialize <ProjectInfo>(Path.Combine(folderBrowser.SelectedPath,
                                                                                       Settings.Default.PROJECTCONFIG));
                    CoreEditor.LoadProject(info);
                    Log.Info("加载项目成功");
                }
                catch (Exception exception)
                {
                    Log.Error("加载项目失败:" + exception.Message);
                }
            }
        }
Ejemplo n.º 2
0
        private void NewProjectOnClick(object sender, EventArgs e)
        {
            var newProjectForm = new NewProjectForm();

            if (newProjectForm.ShowDialog() == DialogResult.Yes)
            {
                // 创建完成
                CoreEditor.LoadProject(newProjectForm.Info);
            }
        }