/// <summary> /// Attempts to find an existing file in the set of include dirs, /// given the relative path. /// </summary> /// <param name="relativePath">The relative file path to search for</param> /// <returns>The absolute path string. Null if an existing file cannot be found.</returns> public FilePath GetFilePathFromRelativePath(string relativePath) { var includeDirs = IsInternal ? Settings.Default.IncludeDirs.Cast <string>().Select(path => new FilePath(path)) : IncludeDirs; foreach (FilePath dir in includeDirs.Where(dir => File.Exists(Path.Combine(dir, relativePath)))) { return(dir.Combine(relativePath)); } if (IsInternal) { return(null); } return(File.Exists(ProjectDirectory.Combine(relativePath)) ? ProjectDirectory.Combine(relativePath) : null); }