コード例 #1
0
        void showNewProjectDialog()
        {
            editorController.stopPlayingTimelines();

            Browser     browse  = new Browser("Project Templates", "Create Project");
            BrowserNode appNode = new BrowserNode("App", new AppProjectTemplate());

            browse.addNode(null, null, appNode);
            browse.DefaultSelection = appNode;
            browse.addNode(null, null, new BrowserNode("Question App", new QuestionAppProjectTemplate()));
            browse.addNode(null, null, new BrowserNode("Empty", new EmptyProjectTemplate()));
            browse.addNode(null, null, new BrowserNode("Dependency Project", new DependencyProjectTemplate()));

            NewProjectDialog.ShowDialog(browse, (projectDialog) =>
            {
                ProjectTemplate template = projectDialog.SelectedValue;
                String fullProjectName   = projectDialog.FullProjectName;
                if (Directory.Exists(fullProjectName))
                {
                    MessageBox.show(String.Format("The project {0} already exists. Would you like to delete it and create a new one?", fullProjectName), "Overwrite?", MessageBoxStyle.IconQuest | MessageBoxStyle.Yes | MessageBoxStyle.No, result =>
                    {
                        if (result == MessageBoxStyle.Yes)
                        {
                            editorController.createNewProject(fullProjectName, true, template);
                        }
                    });
                }
                else
                {
                    editorController.createNewProject(fullProjectName, false, template);
                }
            });
        }