void CreateProject(Solution solution, SolutionFolder srcFolder, bool newSolution = true)
        {
            string     projectName = Parameters["UserDefinedProjectName"];
            DnxProject project     = CreateProject(solution, projectName);

            srcFolder.AddItem(project.Project);

            project.AddConfigurations();

            if (newSolution)
            {
                solution.StartupItem = project.Project;
                solution.GenerateDefaultDnxProjectConfigurations(project);
            }
            else
            {
                solution.EnsureConfigurationHasBuildEnabled(project);
            }

            project.CreateProjectDirectory();

            if (Parameters.GetBoolValue("CreateWebRoot"))
            {
                project.CreateWebRootDirectory();
            }

            RemoveProjectDirectoryCreatedByNewProjectDialog(solution.BaseDirectory, projectName);

            CreateFilesFromTemplate(project);

            OpenProjectFile(project);

            IdeApp.ProjectOperations.SaveAsync(solution)
            .ContinueWith(t => {
                Runtime.RunInMainThread(() => {
                    DnxServices.ProjectService.OnSolutionLoaded(solution);
                });
            });
        }
Exemplo n.º 2
0
        void CreateProject(Solution solution, SolutionFolder srcFolder, bool newSolution = true)
        {
            string     projectName = Parameters["UserDefinedProjectName"];
            DnxProject project     = CreateProject(solution, projectName);

            srcFolder.AddItem(project);

            project.AddConfigurations();

            if (newSolution)
            {
                solution.GenerateDefaultDnxProjectConfigurations(project);
                solution.StartupItem = project;
            }
            else
            {
                solution.EnsureConfigurationHasBuildEnabled(project);
            }

            project.CreateProjectDirectory();

            if (Parameters.GetBoolean("CreateWebRoot"))
            {
                project.CreateWebRootDirectory();
            }

            RemoveProjectDirectoryCreatedByNewProjectDialog(solution.BaseDirectory, projectName);

            CreateFilesFromTemplate(project);

            solution.Save(new NullProgressMonitor());

            OpenProjectFile(project);

            DnxServices.ProjectService.LoadAspNetProjectSystem(solution);
        }