Inheritance: FileSystemProject, IStandardProject
Exemple #1
0
        private void RemoveFiles(CPlusPlusProject project, IProjectFolder folder)
        {
            foreach (var item in folder.Items)
            {
                if (item is IProjectFolder)
                {
                    RemoveFiles(project, item as IProjectFolder);
                    project.Folders.Remove(item as IProjectFolder);
                }

                if (item is ISourceFile)
                {
                    project.SourceFiles.Remove(item as ISourceFile);
                }
            }
        }
Exemple #2
0
        public static CPlusPlusProject Create(string directory, string name)
        {
            CPlusPlusProject result = null;

            var projectFile = Path.Combine(directory, GenerateProjectFileName(name));

            if (!System.IO.File.Exists(projectFile))
            {
                var project = new CPlusPlusProject();
                project.Location = projectFile;

                project.Save();

                result = project;
            }

            return(result);
        }
Exemple #3
0
        public virtual async Task <IProject> Generate(ISolution solution, string name)
        {
            var location = Path.Combine(solution.CurrentDirectory, name);

            if (!Directory.Exists(location))
            {
                Directory.CreateDirectory(location);
            }

            IProject project = CPlusPlusProject.Create(solution, location, name);

            project = solution.AddProject(project);

            if (solution.StartupProject == null)
            {
                solution.StartupProject = project;
            }

            return(project);
        }
Exemple #4
0
        public CPlusPlusProject GetReference(Reference reference)
        {
            CPlusPlusProject result = null;

            foreach (var project in Solution.Projects)
            {
                if (project.Name == reference.Name)
                {
                    result = project as CPlusPlusProject;
                    break;
                }
            }

            if (result == null)
            {
                throw new Exception(string.Format("Unable to find reference {0}, in directory {1}", reference.Name,
                                                  Solution.CurrentDirectory));
            }

            return(result);
        }
 public Task <IProject> LoadAsync(ISolution solution, string filePath)
 {
     return(Task.Run(() => CPlusPlusProject.LoadFromFile(filePath) as IProject));
 }
        private void RemoveFiles(CPlusPlusProject project, IProjectFolder folder)
        {
            foreach (var item in folder.Items)
            {
                if (item is IProjectFolder)
                {
                    RemoveFiles(project, item as IProjectFolder);
                    project.Folders.Remove(item as IProjectFolder);
                }

                if (item is ISourceFile)
                {
                    project.SourceFiles.Remove(item as ISourceFile);
                }
            }
        }
        public static CPlusPlusProject Create(ISolution solution, string directory, string name)
        {
            CPlusPlusProject result = null;

            var projectFile = Path.Combine(directory, GenerateProjectFileName(name));

            if (!System.IO.File.Exists(projectFile))
            {
                var project = new CPlusPlusProject();
                project.Solution = solution;
                project.Location = projectFile;
                
                project.Save();
                project.LoadFiles();

                result = project;
            }

            return result;
        }
 public IProject Load(ISolution solution, string filePath)
 {
     return(CPlusPlusProject.Load(filePath, solution));
 }