Esempio n. 1
0
 private ProjectItem CreateProjectItem(Match match)
 {
     var projectTitle = match.Result("${Title}");
     var projectPath = match.Result("${Location}");
     var projectItem = new ProjectItem {Name = projectTitle, Path = projectPath};
     return projectItem;
 }
Esempio n. 2
0
 public RepositoryItem CreateProjectItem(string solutionFolder, ProjectItem projectItem, string repositoryRoot)
 {
     var projectFilePath = FileSystem.Combine(solutionFolder,
                                              projectItem.Path);
     if (!_fileSystem.FileExists(projectFilePath)) {
         return null;
     }
     // touch the project so that it is compiled
     _projectFactory.GetProjectData(projectFilePath);
     var projectRepositoryItem = new RepositoryItem()
     {
         Name = projectItem.Name,
         Type = "folder",
         Data = new Dictionary<string, string> { { "ProjectPath", projectFilePath.PathRelativeTo(repositoryRoot)} }
     };
     var projectFileContent = _fileSystem.ReadStringFromFile(projectFilePath);
     var projectFolderRelativeToRepositoryRoot = projectFilePath.ParentDirectory().PathRelativeTo(repositoryRoot);
     var fileItems = _projectParser.GetCompiledFiles(projectFileContent);
     projectRepositoryItem.Children.AddRange(_converter.Convert(fileItems, projectFolderRelativeToRepositoryRoot));
     return projectRepositoryItem;
 }