static IEnumerable <SccFileSystemNode> DoGetDirectoryNodes(SccFileSystemNode result, SafeFindHandle findHandle) { string basePath = result._basePath; using (findHandle) { if (!IsDotPath(result.Name)) { yield return(result); } NativeMethods.WIN32_FIND_DATA data; while (NativeMethods.FindNextFileW(findHandle, out data)) { if (IsDotPath(data.cFileName)) { continue; } yield return(new SccFileSystemNode(basePath, data.cFileName, (FileAttributes)data.dwFileAttributes)); } } }
private static bool IsDotPath(SccFileSystemNode result) { string p = result.Name; if (p.Length == 1 && p[0] == '.') return true; else if (p.Length == 2 && p == "..") return true; return false; }
static IEnumerable<SccFileSystemNode> DoGetDirectoryNodes(SccFileSystemNode result, SafeFindHandle findHandle) { string basePath = result._basePath; using (findHandle) { if (!IsDotPath(result)) yield return result; NativeMethods.WIN32_FIND_DATA data; while (NativeMethods.FindNextFileW(findHandle, out data)) { result = new SccFileSystemNode(basePath, data); if (!IsDotPath(result)) yield return result; } } }