コード例 #1
0
        public IEnumerable <string> TryGetSourcePaths(string sourcePath)
        {
            if (!File.Exists(sourcePath))
            {
                return(null);
            }

            var isProject = ProjectFileUtility.IsPathProject(sourcePath);

            return(isProject ? new[] { sourcePath } : null);
        }
コード例 #2
0
        public IEnumerable <string> GetProjectCleanupPaths(PathInfo sourcePath)
        {
            var directoryPath = sourcePath.IsFile
                ? Path.GetDirectoryName(sourcePath.Value)
                : sourcePath.Value;

            var projectPaths =
                ProjectFileUtility.IsPathProject(sourcePath.Value)
                    ? ProjectFileParser.GetProjectFilePaths(sourcePath.Value)
                    : Enumerable.Empty <string>();

            foreach (var projectPath in projectPaths)
            {
                yield return(Path.Combine(directoryPath, projectPath));
            }

            foreach (var cleanPath in _context.CleanPaths)
            {
                yield return(Path.Combine(directoryPath, cleanPath));
            }
        }