private IProjectFolder GetProjectFolder(ProjectLayoutOutput entry) { var project = default(IProject); if (!string.IsNullOrWhiteSpace(entry.ProjectType)) { project = this.ProjectCollection.GetFirstProjectByType(entry.ProjectType); } else { project = this.ProjectCollection.GetProjectByName(entry.ProjectName); } return(project.GetFolder(entry.FolderPath)); }
private void ValidateOutputEntry(ProjectLayoutOutput entry) { var folderPathSet = !string.IsNullOrWhiteSpace(entry.FolderPath); var projectNameSet = !string.IsNullOrWhiteSpace(entry.ProjectName); var projectTypeSet = !string.IsNullOrWhiteSpace(entry.ProjectType); if (folderPathSet) { if (projectNameSet && projectTypeSet) { throw new ConfigurationException("Both project name and type cannot be set for a project layout entry."); } if (!projectNameSet && !projectTypeSet) { throw new ConfigurationException("Either project name or type must be set for a project layout entry."); } } else if (projectNameSet || projectTypeSet) { throw new ConfigurationException("Project name or type cannot be set when folder path is not set."); } }