示例#1
0
        private FileSystemPath ConvertToAbsolutePath(FileSystemPath path)
        {
            if (path.IsAbsolute)
            {
                return(path);
            }

            return(_possiblePaths
                   .Value.SelectNotNull(possibleDir =>
            {
                var relativePath = path.AsRelative();
                if (relativePath == null || relativePath.IsEmpty)
                {
                    return null;
                }

                var candidate = possibleDir / relativePath;
                return candidate.Exists == FileSystemPath.Existence.Missing ? null : candidate;
            })
                   .FirstOrDefault(null));
        }