Beispiel #1
0
        public ICodeEditPackage ParseFile(char[] chars, string path)
        {
            ICsProject project = ICsProjectFactory.create(project_namespace.pn_project_namespace);
            ICsFile    file    = ICsFileFactory.create(chars, path);

            project.setBuildEntityModel(true);
            project.addFiles(file);
            project.parse(true, true);

            var unit = file.getCompilationUnit();

            return(null);
        }
        public void WriteToProject(string projectFolderPath, string projectName, string folderName, ICsFile file)
        {
            var csprojFilePath = Path.Join(projectFolderPath, projectName + ".csproj");
            var filePath       = Path.Join(projectFolderPath, folderName, file.FileName);

            var fileExistedBefore = File.Exists(filePath);

            File.WriteAllText(filePath, file.Contents);

            if (fileExistedBefore)
            {
                return;
            }

            AddFileToProject(csprojFilePath, filePath);
        }