private static IEnumerable <IProjectFile> GetNetCoreJsonConfigFiles(IProjectFolder project) { var additionalConfigurationFiles = project.GetSolution().GetAdditionalConfigurationFiles(); return(project.GetAllProjectFiles( file => file.LanguageType.Is <JsonProjectFileType>() && (file.Name.Equals(FileNames.NetCoreAppSettingsJson, StringComparison.OrdinalIgnoreCase) || additionalConfigurationFiles.Contains(file.GetPersistentID())))); }
private static IEnumerable <IProjectFile> GetXmlConfigFiles(IProjectFolder project) { var additionalConfigurationFiles = project.GetSolution().GetAdditionalConfigurationFiles(); var xmlConfigFiles = new HashSet <IProjectFile>( project.GetAllProjectFiles( file => file.LanguageType.Is <XmlProjectFileType>() && (file.Name.Equals(FileNames.WebConfig, StringComparison.OrdinalIgnoreCase) || file.Name.Equals(FileNames.AppConfig, StringComparison.OrdinalIgnoreCase) || additionalConfigurationFiles.Contains(file.GetPersistentID())))); UnionWithDependentFiles(xmlConfigFiles); return(xmlConfigFiles); }
public static IList <Tuple <string, bool> > ExtractFolders(IProjectFolder currentFolder) { IList <Tuple <string, bool> > foldersList = new List <Tuple <string, bool> >(); var namespaceFolderProperty = currentFolder.GetSolution().GetComponent <NamespaceFolderProperty>(); while (currentFolder != null) { if (currentFolder.Kind == ProjectItemKind.PHYSICAL_DIRECTORY) { foldersList.Insert(0, new Tuple <string, bool>(currentFolder.Name, namespaceFolderProperty.GetNamespaceFolderProperty(currentFolder))); } currentFolder = currentFolder.ParentFolder; } return(foldersList); }