Ejemplo n.º 1
0
        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));
                }
            }
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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;
                }
            }
        }