public bool Find(IEnumerable <string> pathParts, ref PathBase last) { var fp = pathParts.First(); var path = Childs.GetSorted(p => string.Compare(fp, p.Name, StringComparison.OrdinalIgnoreCase)); if (path == null) { return(false); } last = path; return(pathParts.Count() == 1 || (path is PathPart && (path as PathPart).Find(pathParts.Skip(1), ref last))); }
public bool Find(IEnumerable <string> pathParts, out PathBase last) { var fd = pathParts.First(); var drive = Drives.GetSorted(d => string.Compare(fd, d.Name, StringComparison.OrdinalIgnoreCase)); last = drive; return(last != null && (pathParts.Count() == 1 || drive.Find(pathParts.Skip(1), ref last))); }